From e2fa9012fac98fb52cfaa0d342d455a95fdcf6e8 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Mon, 31 Aug 2015 16:40:14 +0200 Subject: [PATCH] Correct neutron-ns-metadata-proxy command when watch_log is False Neutron[1] uses the option --metadata_proxy_watch_log=false to disable log watch[2] in neutron-ns-metadata-proxy instances but should use the option --nometadata_proxy_watch_log. It implies that neutron-ns-metadata-proxy instances fail to start. This changes updates neutron[1] to use the correct option. The change also corrects associated functional tests[2], indeed metadata_proxy_watch_log option has no effect if a log_file/dir is defined for the agent running the neutron-ns-metadata-proxy. [1] neutron.agent.common.config [2] could be done by setting metadata_proxy_watch_log = false [3] neutron.tests.functional.agent.test_l3_agent Closes-Bug: #1490594 Change-Id: Iaec4a78847d802234c99514313440fd7c14bc554 --- neutron/agent/common/config.py | 2 +- neutron/tests/functional/agent/test_l3_agent.py | 4 ++++ neutron/tests/unit/agent/metadata/test_driver.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/neutron/agent/common/config.py b/neutron/agent/common/config.py index b563c969e..100ef34ed 100644 --- a/neutron/agent/common/config.py +++ b/neutron/agent/common/config.py @@ -94,7 +94,7 @@ def get_log_args(conf, log_file_name, **kwargs): if log_dir: cmd_args.append('--log-dir=%s' % log_dir) if kwargs.get('metadata_proxy_watch_log') is False: - cmd_args.append('--metadata_proxy_watch_log=false') + cmd_args.append('--nometadata_proxy_watch_log') else: if conf.use_syslog: cmd_args.append('--use-syslog') diff --git a/neutron/tests/functional/agent/test_l3_agent.py b/neutron/tests/functional/agent/test_l3_agent.py index 986da2c1a..8c86a22ac 100644 --- a/neutron/tests/functional/agent/test_l3_agent.py +++ b/neutron/tests/functional/agent/test_l3_agent.py @@ -96,6 +96,10 @@ class L3AgentTestFramework(base.BaseSudoTestCase): get_temp_file_path = functools.partial(self.get_temp_file_path, root=temp_dir) conf.set_override('state_path', temp_dir.path) + # NOTE(cbrandily): log_file or log_dir must be set otherwise + # metadata_proxy_watch_log has no effect + conf.set_override('log_file', + get_temp_file_path('log_file')) conf.set_override('metadata_proxy_socket', get_temp_file_path('metadata_proxy')) conf.set_override('ha_confs_path', diff --git a/neutron/tests/unit/agent/metadata/test_driver.py b/neutron/tests/unit/agent/metadata/test_driver.py index d86c4fbce..9fa522809 100644 --- a/neutron/tests/unit/agent/metadata/test_driver.py +++ b/neutron/tests/unit/agent/metadata/test_driver.py @@ -121,7 +121,7 @@ class TestMetadataDriverProcess(base.BaseTestCase): router_id] if not watch_log: netns_execute_args.append( - '--metadata_proxy_watch_log=false') + '--nometadata_proxy_watch_log') ip_mock.assert_has_calls([ mock.call(namespace=router_ns), mock.call().netns.execute(netns_execute_args, addl_env=None, -- 2.45.2