diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-05-29 08:57:58 +0100 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-05-30 21:24:53 +0100 |
| commit | 00786bc554a2dfacb3c6f02fbb7e9c98f35d4262 (patch) | |
| tree | 93cc4a0cd0af8a9db30eb5fa02365f0f01207627 /nova/flags.py | |
| parent | d7e613dabc2dbc28d9405a5b450dc2b4dfa9d47b (diff) | |
Use cfg's new global CONF object
Implements blueprint cfg-global-object
Replace nova.flags.FLAGS with openstack.common.cfg.CONF.
In future, we can do a s/FLAGS/CONF/ across the codebase.
Change-Id: Ib293873089a5399febd7a3b0410f66e9bef115f1
Diffstat (limited to 'nova/flags.py')
| -rw-r--r-- | nova/flags.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/nova/flags.py b/nova/flags.py index 337dc979c..22b5d7d26 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -33,19 +33,14 @@ import sys from nova.openstack.common import cfg -class NovaConfigOpts(cfg.CommonConfigOpts): +FLAGS = cfg.CONF - def __init__(self, *args, **kwargs): - if 'project' not in kwargs: - kwargs['project'] = 'nova' - super(NovaConfigOpts, self).__init__(*args, **kwargs) - self.disable_interspersed_args() - def __call__(self, argv): - return argv[:1] + super(NovaConfigOpts, self).__call__(argv[1:]) - - -FLAGS = NovaConfigOpts() +def parse_args(argv, default_config_files=None): + FLAGS.disable_interspersed_args() + return argv[:1] + FLAGS(argv[1:], + project='nova', + default_config_files=default_config_files) class UnrecognizedFlag(Exception): |
