If the uid pool is not in use _TryReadUidFile will try to return "uid"
even if it hasn't tried to read it at all.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
if os.path.exists(uid_file):
try:
uid = int(utils.ReadFile(uid_file))
+ return uid
except EnvironmentError:
logging.warning("Can't read uid file", exc_info=True)
- return None
except (TypeError, ValueError):
logging.warning("Can't parse uid file contents", exc_info=True)
- return None
- return uid
+ return None
@classmethod
def _RemoveInstanceRuntimeFiles(cls, pidfile, instance_name):