diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-06-22 09:33:46 -0400 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-06-22 09:33:46 -0400 |
| commit | 13a51049ce5e76fd679b3dee978edce58db21d09 (patch) | |
| tree | 9bb319a79083aaa2b596a8fba6a654ba156049b0 /nova/utils.py | |
| parent | 186598a819c4e9c4b1b76aad61e7df56cdddd5be (diff) | |
| download | nova-13a51049ce5e76fd679b3dee978edce58db21d09.tar.gz nova-13a51049ce5e76fd679b3dee978edce58db21d09.tar.xz nova-13a51049ce5e76fd679b3dee978edce58db21d09.zip | |
fix some issues with flags and logging
Diffstat (limited to 'nova/utils.py')
| -rw-r--r-- | nova/utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nova/utils.py b/nova/utils.py index e2ac16f31..a9b0f3128 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -226,8 +226,10 @@ def novadir(): return os.path.abspath(nova.__file__).split('nova/__init__.pyc')[0] -def default_flagfile(filename='nova.conf'): - for arg in sys.argv: +def default_flagfile(filename='nova.conf', args=None): + if args is None: + args = sys.argv + for arg in args: if arg.find('flagfile') != -1: break else: @@ -239,8 +241,8 @@ def default_flagfile(filename='nova.conf'): filename = "./nova.conf" if not os.path.exists(filename): filename = '/etc/nova/nova.conf' - flagfile = ['--flagfile=%s' % filename] - sys.argv = sys.argv[:1] + flagfile + sys.argv[1:] + flagfile = '--flagfile=%s' % filename + args.insert(1, flagfile) def debug(arg): |
