Merge "Update cfg from openstack-common"

This commit is contained in:
Jenkins
2012-02-07 23:53:42 +00:00
committed by Gerrit Code Review
2 changed files with 20 additions and 5 deletions

View File

@@ -179,3 +179,18 @@ without the patch and passes with the patch.
For more information on creating unit tests and utilizing the testing
infrastructure in OpenStack Nova, please read nova/testing/README.rst.
openstack-common
----------------
A number of modules from openstack-common are imported into the project.
These modules are "incubating" in openstack-common and are kept in sync
with the help of openstack-common's update.py script. See:
http://wiki.openstack.org/CommonLibrary#Incubation
The copy of the code should never be directly modified here. Please
always update openstack-common first and then run the script to copy
the changes across.

View File

@@ -69,7 +69,7 @@ class FlagValues(object):
def __init__(self):
self._conf = cfg.ConfigOpts()
self._conf._oparser.disable_interspersed_args()
self._conf.disable_interspersed_args()
self._opts = {}
self.Reset()
@@ -128,7 +128,7 @@ class FlagValues(object):
self._conf.set_default(name, default)
def __iter__(self):
return self.FlagValuesDict().iterkeys()
return self._conf.iterkeys()
def __getitem__(self, name):
self._parse()
@@ -147,12 +147,12 @@ class FlagValues(object):
def FlagValuesDict(self):
self._parse()
ret = {}
for opt in self._opts.values():
ret[opt.dest] = getattr(self, opt.dest)
for name in self._conf:
ret[name] = getattr(self, name)
return ret
def add_option(self, opt):
if opt.dest in self._opts:
if opt.dest in self._conf:
return
self._opts[opt.dest] = opt