Skip to content
Snippets Groups Projects
Commit 416c8767 authored by John Hodge's avatar John Hodge
Browse files

VendServer - Log when a vend fails

parent cb678a0f
Branches
No related merge requests found
......@@ -448,12 +448,13 @@ class VendServer():
exitcode = os.system('dispense -u "%s" snack:%s'%(self.vstatus.username, self.vstatus.cur_selection)) >> 8
if (exitcode == 0):
# magic dispense syslog service
syslog.syslog(syslog.LOG_INFO | syslog.LOG_LOCAL4, "vended %s (slot %s) for %s" % (name, self.vstatus.cur_selection, self.vstatus.username))
(worked, code, string) = self.v.vend(self.vstatus.cur_selection)
if worked:
self.v.display('THANK YOU')
syslog.syslog(syslog.LOG_INFO | syslog.LOG_LOCAL4, "vended %s (slot %s) for %s" % (name, self.vstatus.cur_selection, self.vstatus.username))
else:
print "Vend Failed:", code, string
syslog.syslog(syslog.LOG_WARNING | syslog.LOG_LOCAL4, "vending %s (slot %s) for %s FAILED %r %r" % (name, self.vstatus.cur_selection, self.vstatus.username, code, string))
self.v.display('VEND FAIL')
elif (exitcode == 5): # RV_BALANCE
self.v.display('NO MONEY?')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment