Merge "Support custom config files in admin utilities"

This commit is contained in:
Zuul 2020-06-20 05:08:05 +00:00 committed by Gerrit Code Review
commit d8aa8db80c
2 changed files with 17 additions and 7 deletions

View File

@ -1,9 +1,12 @@
Admin Utility
=============
NSX-V and NSX-T support the nsxadmin utility. This enables and administrator to determine and rectify inconsistencies between the Neutron DB and NSX.
The VMWare NSX plugins support the nsxadmin utility. This enables and administrator to determine and rectify inconsistencies between the Neutron DB and NSX, in addition to performing different configuration changes and migrations.
usage: nsxadmin -r <resources> -o <operation>
In order to specify config files:
usage: nsxadmin --config-file <neutron config path> --config-file <nsx config path > -r <resources> -o <operation>
NSX-V Plugin
------------

View File

@ -56,16 +56,23 @@ def _init_cfg():
# register must come after above unregister to avoid duplicates
cfg.CONF.register_cli_opts(resources.cli_opts)
# Init the neutron config
neutron_config.init(args=['--config-file', constants.NEUTRON_CONF,
'--config-file', constants.NSX_INI])
# Make sure the default config files are used if not specified in args
default_config_files = [constants.NEUTRON_CONF,
constants.NSX_INI]
config_args = sys.argv[1:]
if '--config-file' not in config_args:
# Add default config files
config_args = []
for file in default_config_files:
config_args.extend(['--config-file', file])
cfg.CONF(args=sys.argv[1:], project='NSX',
# Init the CONF and neutron config (Used by the core plugin)
neutron_config.init(args=config_args)
cfg.CONF(args=config_args, project='NSX',
prog='Admin Utility',
version=version.__version__,
usage='nsxadmin -r <resources> -o <operation>',
default_config_files=[constants.NEUTRON_CONF,
constants.NSX_INI])
default_config_files=default_config_files)
def _validate_resource_choice(resource, nsx_plugin):