From 3fe5ba7dbdcb38ad1fcf8b3ea344bc1aab7f072a Mon Sep 17 00:00:00 2001 From: aguerre Date: Mon, 25 Nov 2013 13:05:48 +0000 Subject: [PATCH] Catch error if config file does not exist --- bin/PortManager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/PortManager.py b/bin/PortManager.py index 56e81f106..0ad853a9b 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -295,16 +295,16 @@ def __checkServer(): def __getServerAddress(readonly=True): address = ("localhost", 0) - config_file, lock_file = _getConfigurationFilename() - lock = PortManagerLock(config_file, readonly, blocking=True) - lock.acquire() try: + config_file, lock_file = _getConfigurationFilename() + lock = PortManagerLock(config_file, readonly, blocking=True) + lock.acquire() address = eval(lock.handle.read()) + lock.release() except (IOError, SyntaxError) as e: logger.debug("no configuration file") pass finally: - lock.release() return address # -- 2.39.2