[Admin utils] Also include fwaas.conf in default config files

Include /etc/neutron/fwaas.conf in default config files and verify
each file exists before using it in the admin util command.

Change-Id: Ibd53dcb0824eef89f03c27a9dea9a12aede1d370
This commit is contained in:
Salvatore Orlando 2021-11-05 09:27:02 -07:00 committed by Salvatore Orlando
parent 819a4f9364
commit fbb3f64261
2 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,7 @@
# Default conf file locations
NEUTRON_CONF = '/etc/neutron/neutron.conf'
FWAAS_CONF = '/etc/neutron/fwaas.conf'
NSX_INI = '/etc/neutron/plugins/vmware/nsx.ini'
# NSX Plugin Constants

View File

@ -23,6 +23,7 @@ delete-security-groups, nsx neutron nsxv3 can be options
TODO: Autocomplete command line args
"""
from os import path
import sys
from neutron.common import config as neutron_config
@ -58,12 +59,15 @@ def _init_cfg():
# Make sure the default config files are used if not specified in args
default_config_files = [constants.NEUTRON_CONF,
constants.NSX_INI]
constants.NSX_INI,
constants.FWAAS_CONF]
config_args = sys.argv[1:]
if '--config-file' not in config_args:
# Add default config files
for file in default_config_files:
config_args.extend(['--config-file', file])
if path.exists(file):
config_args.extend(['--config-file', file])
# Init the CONF and neutron config (Used by the core plugin)
neutron_config.init(args=config_args)