From 341c756c50dfd128ca9e0a3c75e59be3bb3dfa11 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Wed, 24 Oct 2012 19:41:31 +0100 Subject: [PATCH] Ensure utils.find_config() raises correctly on failure to find config --- moniker/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/moniker/utils.py b/moniker/utils.py index 122bd945..d8118dc4 100644 --- a/moniker/utils.py +++ b/moniker/utils.py @@ -14,10 +14,13 @@ # License for the specific language governing permissions and limitations # under the License. import os +from moniker.openstack.common import log as logging from moniker.openstack.common import cfg from moniker.openstack.common.notifier import api as notifier_api from moniker import exceptions +LOG = logging.getLogger(__name__) + def notify(context, service, event_type, payload): priority = 'INFO' @@ -47,7 +50,8 @@ def find_config(config_path): ] for path in possible_locations: + LOG.debug('Checking path: %s' % path) if os.path.exists(path): return os.path.abspath(path) - raise exceptions.ConfigNotFound(os.path.abspath(config_path)) + raise exceptions.ConfigNotFound(config_path)