Fix logging and pin checking in OpenDispense.py
authorMark Tearle <mark@tearle.com>
Mon, 6 Apr 2015 09:16:05 +0000 (17:16 +0800)
committerMark Tearle <mark@tearle.com>
Mon, 6 Apr 2015 09:42:13 +0000 (17:42 +0800)
VendServer/OpenDispense.py

index 4eadcf6..3790348 100644 (file)
@@ -9,6 +9,7 @@ Documentation for this code can be found inder Dispence.DispenceInterface
 
 from DispenseInterface import DispenseInterface
 import os
+import logging
 import re
 import pwd
 from subprocess import Popen, PIPE
@@ -24,9 +25,11 @@ class OpenDispense(DispenseInterface):
                pass
 
        def authUserIdPin(self, userId, pin):
+               userId = int(userId)
+
                try:
                        # Get info from 
-                       info = pwd.getpwuid(int(userId))
+                       info = pwd.getpwuid(userId)
                except KeyError:
                        logging.info('getting pin for uid %d: user not in password file'%userId)
                        return False

UCC git Repository :: git.ucc.asn.au