summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-06-23 10:06:44 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2011-06-23 10:06:44 -0400
commit2690e31bbd8c515771ca69a0a73e9ff5761a9079 (patch)
treed30b12abd962fc43e4a44fad207cefd0776e15c8 /nova/utils.py
parent186598a819c4e9c4b1b76aad61e7df56cdddd5be (diff)
parent2059a683e11169a35b35819575926fc6cbc1a3f1 (diff)
downloadnova-2690e31bbd8c515771ca69a0a73e9ff5761a9079.tar.gz
nova-2690e31bbd8c515771ca69a0a73e9ff5761a9079.tar.xz
nova-2690e31bbd8c515771ca69a0a73e9ff5761a9079.zip
Merged markwash's fixes.
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py10
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):