From d05b9790e84e95e256947216572ad67807ae064a Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Fri, 9 Jan 2015 10:02:19 -0800 Subject: [PATCH] Move agent cleanup scripts to cmd module Ensure naming consistency across the various entry points. This patch better separates active elements of Neutron agents from operator's utilities. Along with [1,2,3], this is done to better delineate what the agent module inner boundaries are about. More to follow to finish off the cleanup. [1] https://review.openstack.org/#/c/146024/ [2] https://review.openstack.org/#/c/145979/ [3] https://review.openstack.org/#/c/146239/ Change-Id: I1d2d2938aa7fa1c60e0f0dc70997778a1930efef --- neutron/{agent/netns_cleanup_util.py => cmd/netns_cleanup.py} | 0 neutron/{agent/ovs_cleanup_util.py => cmd/ovs_cleanup.py} | 0 .../{test_agent_netns_cleanup.py => test_netns_cleanup.py} | 2 +- .../unit/{test_agent_ovs_cleanup.py => test_ovs_cleanup.py} | 4 ++-- setup.cfg | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename neutron/{agent/netns_cleanup_util.py => cmd/netns_cleanup.py} (100%) rename neutron/{agent/ovs_cleanup_util.py => cmd/ovs_cleanup.py} (100%) rename neutron/tests/unit/{test_agent_netns_cleanup.py => test_netns_cleanup.py} (99%) rename neutron/tests/unit/{test_agent_ovs_cleanup.py => test_ovs_cleanup.py} (97%) diff --git a/neutron/agent/netns_cleanup_util.py b/neutron/cmd/netns_cleanup.py similarity index 100% rename from neutron/agent/netns_cleanup_util.py rename to neutron/cmd/netns_cleanup.py diff --git a/neutron/agent/ovs_cleanup_util.py b/neutron/cmd/ovs_cleanup.py similarity index 100% rename from neutron/agent/ovs_cleanup_util.py rename to neutron/cmd/ovs_cleanup.py diff --git a/neutron/tests/unit/test_agent_netns_cleanup.py b/neutron/tests/unit/test_netns_cleanup.py similarity index 99% rename from neutron/tests/unit/test_agent_netns_cleanup.py rename to neutron/tests/unit/test_netns_cleanup.py index ef10b8ab5..59383f428 100644 --- a/neutron/tests/unit/test_agent_netns_cleanup.py +++ b/neutron/tests/unit/test_netns_cleanup.py @@ -16,7 +16,7 @@ import mock from neutron.agent.linux import interface -from neutron.agent import netns_cleanup_util as util +from neutron.cmd import netns_cleanup as util from neutron.tests import base diff --git a/neutron/tests/unit/test_agent_ovs_cleanup.py b/neutron/tests/unit/test_ovs_cleanup.py similarity index 97% rename from neutron/tests/unit/test_agent_ovs_cleanup.py rename to neutron/tests/unit/test_ovs_cleanup.py index 2735fbac6..de7900039 100644 --- a/neutron/tests/unit/test_agent_ovs_cleanup.py +++ b/neutron/tests/unit/test_ovs_cleanup.py @@ -19,7 +19,7 @@ import mock from neutron.agent.linux import ip_lib from neutron.agent.linux import ovs_lib -from neutron.agent import ovs_cleanup_util as util +from neutron.cmd import ovs_cleanup as util from neutron.openstack.common import uuidutils from neutron.tests import base @@ -47,7 +47,7 @@ class TestOVSCleanup(base.BaseTestCase): conf.external_network_bridge = 'br-ex' with contextlib.nested( mock.patch('neutron.common.config.setup_logging'), - mock.patch('neutron.agent.ovs_cleanup_util.setup_conf', + mock.patch('neutron.cmd.ovs_cleanup.setup_conf', return_value=conf), mock.patch('neutron.agent.linux.ovs_lib.get_bridges', return_value=bridges), diff --git a/setup.cfg b/setup.cfg index ab04d570c..293716a7a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -108,12 +108,12 @@ console_scripts = neutron-metadata-agent = neutron.agent.metadata_agent:main neutron-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main neutron-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main - neutron-netns-cleanup = neutron.agent.netns_cleanup_util:main + neutron-netns-cleanup = neutron.cmd.netns_cleanup:main neutron-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main neutron-nsx-manage = neutron.plugins.vmware.shell:main neutron-nvsd-agent = neutron.plugins.oneconvergence.agent.nvsd_neutron_agent:main neutron-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main - neutron-ovs-cleanup = neutron.agent.ovs_cleanup_util:main + neutron-ovs-cleanup = neutron.cmd.ovs_cleanup:main neutron-restproxy-agent = neutron.plugins.bigswitch.agent.restproxy_agent:main neutron-server = neutron.server:main neutron-rootwrap = oslo.rootwrap.cmd:main -- 2.45.2