File make-quantum-ns-metadata-proxy-configurable.patch of Package openstack-quantum

--- a/quantum/agent/dhcp_agent.py	2013-08-01 14:34:33.848000000 +0000
+++ b/quantum/agent/dhcp_agent.py	2013-08-01 14:35:55.232000000 +0000
@@ -66,6 +66,10 @@
                     help=_("Allows for serving metadata requests from a "
                            "dedicated network. Requires "
                            "enable_isolated_metadata = True")),
+        cfg.StrOpt('metadata_proxy_socket',
+                   default='$state_path/metadata_proxy',
+                   help=_('Location of Metadata Proxy UNIX domain '
+                          'socket')),
     ]
 
     def __init__(self, host=None):
@@ -316,8 +320,10 @@
                                         router_ports[0].device_id)
 
         def callback(pid_file):
+            metadata_proxy_socket = cfg.CONF.metadata_proxy_socket
             proxy_cmd = ['quantum-ns-metadata-proxy',
                          '--pid_file=%s' % pid_file,
+                         '--metadata_proxy_socket=%s' % metadata_proxy_socket,
                          quantum_lookup_param,
                          '--state_path=%s' % self.conf.state_path,
                          '--metadata_port=%d' % METADATA_PORT]

--- a/quantum/agent/l3_agent.py	2013-08-01 14:35:58.872000000 +0000
+++ b/quantum/agent/l3_agent.py	2013-08-01 14:37:09.320000000 +0000
@@ -141,6 +141,10 @@
         cfg.StrOpt('gateway_external_network_id', default='',
                    help=_("UUID of external network for routers implemented "
                           "by the agents.")),
+        cfg.StrOpt('metadata_proxy_socket',
+                   default='$state_path/metadata_proxy',
+                   help=_('Location of Metadata Proxy UNIX domain '
+                          'socket')),
     ]
 
     def __init__(self, host, conf=None):
@@ -252,8 +256,10 @@
 
     def _spawn_metadata_proxy(self, router_info):
         def callback(pid_file):
+            metadata_proxy_socket = cfg.CONF.metadata_proxy_socket
             proxy_cmd = ['quantum-ns-metadata-proxy',
                          '--pid_file=%s' % pid_file,
+                         '--metadata_proxy_socket=%s' % metadata_proxy_socket,
                          '--router_id=%s' % router_info.router_id,
                          '--state_path=%s' % self.conf.state_path,
                          '--metadata_port=%s' % self.conf.metadata_port]

--- a/quantum/agent/metadata/namespace_proxy.py	2013-08-01 14:37:19.716000000 +0000
+++ b/quantum/agent/metadata/namespace_proxy.py	2013-08-01 14:38:12.288000000 +0000
@@ -31,13 +31,6 @@
 from quantum.openstack.common import log as logging
 from quantum import wsgi
 
-proxy_socket = cfg.StrOpt('metadata_proxy_socket',
-                          default='$state_path/metadata_proxy',
-                          help=_('Location of Metadata Proxy UNIX domain '
-                                 'socket'))
-
-cfg.CONF.register_opt(proxy_socket)
-
 LOG = logging.getLogger(__name__)
 
 
@@ -157,6 +150,10 @@
                    default=9697,
                    help=_("TCP Port to listen for metadata server "
                           "requests.")),
+        cfg.StrOpt('metadata_proxy_socket',
+                   default='$state_path/metadata_proxy',
+                   help=_('Location of Metadata Proxy UNIX domain '
+                          'socket'))
     ]
 
     cfg.CONF.register_cli_opts(opts)

--- a/quantum/tests/unit/test_l3_agent.py	2013-08-01 14:38:46.984000000 +0000
+++ b/quantum/tests/unit/test_l3_agent.py	2013-08-01 14:39:07.752000000 +0000
@@ -502,6 +502,7 @@
                     mock.call().netns.execute([
                         'quantum-ns-metadata-proxy',
                         mock.ANY,
+                        mock.ANY,
                         '--router_id=%s' % router_id,
                         mock.ANY,
                         '--metadata_port=%s' % metadata_port,

--- a/quantum/tests/unit/test_dhcp_agent.py	2013-08-01 14:39:13.840000000 +0000
+++ b/quantum/tests/unit/test_dhcp_agent.py	2013-08-01 14:39:35.912000000 +0000
@@ -607,6 +607,7 @@
                     mock.call().netns.execute([
                         'quantum-ns-metadata-proxy',
                         mock.ANY,
+                        mock.ANY,
                         '--router_id=forzanapoli',
                         mock.ANY,
                         mock.ANY,
openSUSE Build Service is sponsored by