Merge "Make pep8 job succeed when /etc/neutron/neutron.conf is not installed"
This commit is contained in:
commit
185a761624
|
@ -238,10 +238,10 @@ class BaseTestCase(DietTestCase):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def config_parse(conf=None, args=None):
|
def config_parse(conf=None, args=None):
|
||||||
"""Create the default configurations."""
|
"""Create the default configurations."""
|
||||||
# neutron.conf.test includes rpc_backend which needs to be cleaned up
|
# neutron.conf includes rpc_backend which needs to be cleaned up
|
||||||
if args is None:
|
if args is None:
|
||||||
args = []
|
args = []
|
||||||
args += ['--config-file', etcdir('neutron.conf.test')]
|
args += ['--config-file', etcdir('neutron.conf')]
|
||||||
if conf is None:
|
if conf is None:
|
||||||
config.init(args=args)
|
config.init(args=args)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -236,7 +236,7 @@ class TestDhcpAgent(base.BaseTestCase):
|
||||||
with mock.patch.object(sys, 'argv') as sys_argv:
|
with mock.patch.object(sys, 'argv') as sys_argv:
|
||||||
sys_argv.return_value = [
|
sys_argv.return_value = [
|
||||||
'dhcp', '--config-file',
|
'dhcp', '--config-file',
|
||||||
base.etcdir('neutron.conf.test')]
|
base.etcdir('neutron.conf')]
|
||||||
cfg.CONF.register_opts(dhcp_config.DHCP_AGENT_OPTS)
|
cfg.CONF.register_opts(dhcp_config.DHCP_AGENT_OPTS)
|
||||||
config.register_interface_driver_opts_helper(cfg.CONF)
|
config.register_interface_driver_opts_helper(cfg.CONF)
|
||||||
config.register_agent_state_opts_helper(cfg.CONF)
|
config.register_agent_state_opts_helper(cfg.CONF)
|
||||||
|
@ -260,7 +260,7 @@ class TestDhcpAgent(base.BaseTestCase):
|
||||||
with mock.patch.object(sys, 'argv') as sys_argv:
|
with mock.patch.object(sys, 'argv') as sys_argv:
|
||||||
with mock.patch(launcher_str) as launcher:
|
with mock.patch(launcher_str) as launcher:
|
||||||
sys_argv.return_value = ['dhcp', '--config-file',
|
sys_argv.return_value = ['dhcp', '--config-file',
|
||||||
base.etcdir('neutron.conf.test')]
|
base.etcdir('neutron.conf')]
|
||||||
entry.main()
|
entry.main()
|
||||||
launcher.assert_has_calls(
|
launcher.assert_has_calls(
|
||||||
[mock.call(), mock.call().launch_service(mock.ANY),
|
[mock.call(), mock.call().launch_service(mock.ANY),
|
||||||
|
|
|
@ -726,7 +726,7 @@ class ExtensionExtendedAttributeTestCase(base.BaseTestCase):
|
||||||
"ExtensionExtendedAttributeTestPlugin"
|
"ExtensionExtendedAttributeTestPlugin"
|
||||||
)
|
)
|
||||||
|
|
||||||
# point config file to: neutron/tests/etc/neutron.conf.test
|
# point config file to: neutron/tests/etc/neutron.conf
|
||||||
self.config_parse()
|
self.config_parse()
|
||||||
|
|
||||||
self.setup_coreplugin(plugin)
|
self.setup_coreplugin(plugin)
|
||||||
|
|
|
@ -164,7 +164,7 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase):
|
||||||
|
|
||||||
def setup_config(self):
|
def setup_config(self):
|
||||||
# Create the default configurations
|
# Create the default configurations
|
||||||
args = ['--config-file', base.etcdir('neutron.conf.test')]
|
args = ['--config-file', base.etcdir('neutron.conf')]
|
||||||
# If test_config specifies some config-file, use it, as well
|
# If test_config specifies some config-file, use it, as well
|
||||||
for config_file in test_lib.test_config.get('config_files', []):
|
for config_file in test_lib.test_config.get('config_files', []):
|
||||||
args.extend(['--config-file', config_file])
|
args.extend(['--config-file', config_file])
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -72,7 +72,7 @@ commands=
|
||||||
# Checks for coding and style guidelines
|
# Checks for coding and style guidelines
|
||||||
flake8
|
flake8
|
||||||
sh ./tools/coding-checks.sh --pylint '{posargs}'
|
sh ./tools/coding-checks.sh --pylint '{posargs}'
|
||||||
neutron-db-manage check_migration
|
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
|
||||||
whitelist_externals =
|
whitelist_externals =
|
||||||
sh
|
sh
|
||||||
bash
|
bash
|
||||||
|
|
Loading…
Reference in New Issue