|
Related to blueprint cfg-global-object
When using the global config object pattern, you often have modules
which define options that are referenced in other options.
So, for example if module A defined option 'foo' and module be needed
to reference that option, you might do:
import A
print CONF.foo
However, this makes it entirely unclear to the casual reader why
module A was imported.
Nova has a flags.DECLARE() function that helps with this problem
by allowing you to do:
flags.DECLARE('foo', 'A')
The function simply imports module A and checks that the 'foo'
option is now defined in the global config object.
This is fine, but it is also implicit that this function applies
to the global config object. Instead, let's do the following:
CONF.import_opt('foo', 'A')
Change-Id: I7b98f5be71068bbde70cc0eab991eaebb577de52
|