diff options
| author | Jason Kölker <jason@koelker.net> | 2011-12-01 10:55:57 -0600 |
|---|---|---|
| committer | Jason Kölker <jason@koelker.net> | 2011-12-01 10:55:57 -0600 |
| commit | b11410edde201b9f80701a422e8eac58079c3309 (patch) | |
| tree | e037684b8723ce4fae66b06a4017ef860a9406fe /openstack/common | |
| parent | 19440531e96179137534ec52aabfd8b337f09276 (diff) | |
| download | oslo-b11410edde201b9f80701a422e8eac58079c3309.tar.gz oslo-b11410edde201b9f80701a422e8eac58079c3309.tar.xz oslo-b11410edde201b9f80701a422e8eac58079c3309.zip | |
make fix_path a real function so it can be mock'd
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/config.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openstack/common/config.py b/openstack/common/config.py index 3b7968a..a5fc3f0 100644 --- a/openstack/common/config.py +++ b/openstack/common/config.py @@ -176,6 +176,13 @@ def setup_logging(options, conf): root_logger.addHandler(handler) +def fix_path(path): + """ + Return the full absolute path + """ + return os.path.abspath(os.path.expanduser(path)) + + def find_config_file(app_name, options, args, config_dir=None): """ Return the first config file found for an application. @@ -194,7 +201,6 @@ def find_config_file(app_name, options, args, config_dir=None): """ config_dir = config_dir or app_name - fix_path = lambda p: os.path.abspath(os.path.expanduser(p)) if options.get('config_file'): if os.path.exists(options['config_file']): return fix_path(options['config_file']) |
