Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 865582 Details for
Bug 1051036
neutron-l3-agent doesn't clean after itself when service is shut down
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for netns_cleanup
0013-netns-cleanup-util-updated-rhbz-1051036-rhbz-1051028.patch (text/plain), 4.39 KB, created by
Miguel Angel Ajo
on 2014-02-20 15:38:47 UTC
(
hide
)
Description:
Patch for netns_cleanup
Filename:
MIME Type:
Creator:
Miguel Angel Ajo
Created:
2014-02-20 15:38:47 UTC
Size:
4.39 KB
patch
obsolete
>From 6952d54cbc641aa35511a6f1e7a6946270519357 Mon Sep 17 00:00:00 2001 >From: Miguel Angel Ajo <mangelajo@redhat.com> >Date: Thu, 20 Feb 2014 11:57:01 +0100 >Subject: [PATCH] netns cleanup util updated rhbz#1051036 & rhbz#1051028 > >Change-Id: I850f64f6d323580701aaeb712dbf09166ddc4ef2 >--- > neutron/agent/netns_cleanup_util.py | 48 +++++++++++++++++++++++++++++++------ > 1 file changed, 41 insertions(+), 7 deletions(-) > >diff --git a/neutron/agent/netns_cleanup_util.py b/neutron/agent/netns_cleanup_util.py >index 9c17f71..d66fde2 100644 >--- a/neutron/agent/netns_cleanup_util.py >+++ b/neutron/agent/netns_cleanup_util.py >@@ -22,23 +22,31 @@ from oslo.config import cfg > > from neutron.agent.common import config as agent_config > from neutron.agent import l3_agent >+from neutron.agent import dhcp_agent > from neutron.agent.linux import dhcp > from neutron.agent.linux import ip_lib > from neutron.agent.linux import ovs_lib >+from neutron.agent.linux import interface > from neutron.api.v2 import attributes > from neutron.common import config >+from neutron.common import topics >+from neutron import context > from neutron.openstack.common import importutils > from neutron.openstack.common import log as logging > > > LOG = logging.getLogger(__name__) >+ > NS_MANGLING_PATTERN = ('(%s|%s)' % (dhcp.NS_PREFIX, l3_agent.NS_PREFIX) + > attributes.UUID_PATTERN) >+DHCP_NS_MANGLING_PATTERN = dhcp.NS_PREFIX + attributes.UUID_PATTERN >+L3_NS_MANGLING_PATTERN = l3_agent.NS_PREFIX + attributes.UUID_PATTERN > > > class FakeNetwork(object): >- def __init__(self, id): >+ def __init__(self, id, namespace): > self.id = id >+ self.namespace = namespace > > > def setup_conf(): >@@ -52,6 +60,9 @@ def setup_conf(): > cfg.BoolOpt('force', > default=False, > help=_('Delete the namespace by removing all devices.')), >+ cfg.MultiStrOpt('forced_agents', >+ default=['dhcp', 'l3'], >+ help=_('Which agent namespaces to remove: dhcp, l3')), > ] > > opts = [ >@@ -65,6 +76,8 @@ def setup_conf(): > conf.register_opts(opts) > agent_config.register_root_helper(conf) > conf.register_opts(dhcp.OPTS) >+ conf.register_opts(dhcp_agent.DhcpAgent.OPTS) >+ conf.register_opts(interface.OPTS) > return conf > > >@@ -73,11 +86,19 @@ def kill_dhcp(conf, namespace): > root_helper = agent_config.get_root_helper(conf) > network_id = namespace.replace(dhcp.NS_PREFIX, '') > >+ ctx = context.get_admin_context_without_session() >+ >+ plugin_rpc = dhcp_agent.DhcpPluginApi(topics.PLUGIN, >+ ctx, conf.use_namespaces) >+ > dhcp_driver = importutils.import_object( > conf.dhcp_driver, >- conf, >- FakeNetwork(network_id), >- root_helper) >+ conf = conf, >+ network = FakeNetwork(network_id, namespace), >+ root_helper = root_helper, >+ version = None, >+ plugin = plugin_rpc) >+ > > if dhcp_driver.active: > dhcp_driver.disable() >@@ -94,9 +115,21 @@ def eligible_for_deletion(conf, namespace, force=False): > if not re.match(NS_MANGLING_PATTERN, namespace): > return False > >+ # check per-agent forced namespaces >+ forced_agents = [agent.lower() for agent in conf.forced_agents] >+ >+ if force: >+ if (('dhcp' in forced_agents) and >+ (re.match(DHCP_NS_MANGLING_PATTERN, namespace))): >+ return True >+ >+ if (('l3' in forced_agents) and >+ (re.match(L3_NS_MANGLING_PATTERN, namespace))): >+ return True >+ > root_helper = agent_config.get_root_helper(conf) > ip = ip_lib.IPWrapper(root_helper, namespace) >- return force or ip.namespace_is_empty() >+ return ip.namespace_is_empty() > > > def unplug_device(conf, device): >@@ -138,8 +171,7 @@ def destroy_namespace(conf, namespace, force=False): > > > def main(): >- """Main method for cleaning up network namespaces. >- >+ """ > This method will make two passes checking for namespaces to delete. The > process will identify candidates, sleep, and call garbage collect. The > garbage collection will re-verify that the namespace meets the criteria for >@@ -154,9 +186,11 @@ def main(): > installation as it will blindly purge namespaces and their devices. This > option also kills any lingering DHCP instances. > """ >+ > eventlet.monkey_patch() > > conf = setup_conf() >+ > conf() > config.setup_logging(conf) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1051036
: 865582 |
865583
|
865584
|
879527