From: ACC Murphy Date: Tue, 18 Apr 2006 06:52:21 +0000 (+0000) Subject: shift the exit code >>8 X-Git-Tag: IMPORT-FROM-UCCCVS~23 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=f6e16e5e007124724909004020ef4b56935a6848;p=uccvend-vendserver.git shift the exit code >>8 --- diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index 0b45a40..073b14f 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -416,14 +416,14 @@ def make_selection(v, vstatus): price, shortname, name = get_snack( '--' ) dollarprice = "$%.2f" % ( price / 100.0 ) v.display(vstatus.cur_selection+' - %s'%dollarprice) - exitcode = os.system('su - "%s" -c "dispense give oday %d"'%(vstatus.username, price)) + exitcode = os.system('su - "%s" -c "dispense give oday %d"'%(vstatus.username, price)) >> 8 if (exitcode == 0): # magic dispense syslog service syslog.syslog(syslog.LOG_INFO | syslog.LOG_LOCAL4, "vended %s (slot %s) for %s" % (name, vstatus.cur_selection, vstatus.username)) v.vend(vstatus.cur_selection) v.display('THANK YOU') else: - syslog.syslog(syslog.LOG_INFO | syslog.LOG_LOCAL4, "failed vending %s (slot %s) for %s, code %d" % (name, vstatus.cur_selection, vstatus.username, exitcode)) + syslog.syslog(syslog.LOG_INFO | syslog.LOG_LOCAL4, "failed vending %s (slot %s) for %s (code %d)" % (name, vstatus.cur_selection, vstatus.username, exitcode)) v.display('NO MONEY?') sleep(1)