diff --git a/HACKING.rst b/HACKING.rst index 975498a0..b7e2564d 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -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. diff --git a/nova/flags.py b/nova/flags.py index 3f356005..476255af 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -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