]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Correct neutron-ns-metadata-proxy command when watch_log is False
authorCedric Brandily <zzelle@gmail.com>
Mon, 31 Aug 2015 14:40:14 +0000 (16:40 +0200)
committerCedric Brandily <zzelle@gmail.com>
Mon, 31 Aug 2015 21:27:19 +0000 (23:27 +0200)
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
neutron/tests/functional/agent/test_l3_agent.py
neutron/tests/unit/agent/metadata/test_driver.py

index b563c969ed5e7efdf5c351aa78ab1b9d2cb7a2a5..100ef34edb29f5af657ec8980e0f7d05d05e0671 100644 (file)
@@ -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')
index 986da2c1a06d5dc92602d21c85ba91e3615c1f28..8c86a22ac0d46bc33ec2903185b92d80bd1373d2 100644 (file)
@@ -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',
index d86c4fbce015929ab4be756adeb6b8a14a27e441..9fa5228093f34a883e2cb16d7e3dc40d95586fc8 100644 (file)
@@ -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,