diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-03-02 21:54:34 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-03-02 21:54:34 +0000 |
commit | 4777e9b6f90e9b1c5ef5c0b97a8a2dcd93635ddb (patch) | |
tree | 61695ee62c26c6d9f16f1a45a440f44746db4f05 | |
parent | 561ced8402a6173480e4bfb221a482c62868fc2c (diff) | |
parent | 6f2963d75204acd515089b70496f2ca3d0397f60 (diff) | |
download | python-neutronclient-4777e9b6f90e9b1c5ef5c0b97a8a2dcd93635ddb.tar.gz |
Merge "refactor: Avoid overriding run() in cliff command"
-rw-r--r-- | neutronclient/common/extension.py | 8 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/__init__.py | 10 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/agentscheduler.py | 8 | ||||
-rwxr-xr-x | neutronclient/neutron/v2_0/bgp/speaker.py | 8 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/flavor/flavor.py | 4 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/floatingip.py | 4 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/fw/firewallpolicy.py | 4 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/lb/healthmonitor.py | 4 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/nsx/networkgateway.py | 4 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/purge.py | 2 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/quota.py | 2 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/router.py | 6 |
12 files changed, 29 insertions, 35 deletions
diff --git a/neutronclient/common/extension.py b/neutronclient/common/extension.py index f7e361b..90f44a7 100644 --- a/neutronclient/common/extension.py +++ b/neutronclient/common/extension.py @@ -54,14 +54,14 @@ class ClientExtensionList(NeutronClientExtension, neutronV20.ListCommand): class ClientExtensionDelete(NeutronClientExtension, neutronV20.DeleteCommand): - def run(self, parsed_args): + def take_action(self, parsed_args): # NOTE(mdietz): Calls 'execute' to provide a consistent pattern # for any implementers adding extensions with # regard to any other extension verb. return self.execute(parsed_args) def execute(self, parsed_args): - return super(ClientExtensionDelete, self).run(parsed_args) + return super(ClientExtensionDelete, self).take_action(parsed_args) class ClientExtensionCreate(NeutronClientExtension, neutronV20.CreateCommand): @@ -76,11 +76,11 @@ class ClientExtensionCreate(NeutronClientExtension, neutronV20.CreateCommand): class ClientExtensionUpdate(NeutronClientExtension, neutronV20.UpdateCommand): - def run(self, parsed_args): + def take_action(self, parsed_args): # NOTE(mdietz): Calls 'execute' to provide a consistent pattern # for any implementers adding extensions with # regard to any other extension verb. return self.execute(parsed_args) def execute(self, parsed_args): - return super(ClientExtensionUpdate, self).run(parsed_args) + return super(ClientExtensionUpdate, self).take_action(parsed_args) diff --git a/neutronclient/neutron/v2_0/__init__.py b/neutronclient/neutron/v2_0/__init__.py index 9da4828..f7aa291 100644 --- a/neutronclient/neutron/v2_0/__init__.py +++ b/neutronclient/neutron/v2_0/__init__.py @@ -398,12 +398,6 @@ class NeutronCommand(command.Command): shadow_resource = None parent_id = None - # TODO(amotoki): Remove take_action here. It should be an abstract method - # as cliff.command.Command does. To do this, we need to avoid overriding - # run() directly. - def take_action(self, parsed_args): - return self.get_data(parsed_args) - @property def cmd_resource(self): if self.shadow_resource: @@ -518,7 +512,7 @@ class UpdateCommand(NeutronCommand): self.add_known_arguments(parser) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)', parsed_args) self.set_extra_attrs(parsed_args) neutron_client = self.get_client() @@ -575,7 +569,7 @@ class DeleteCommand(NeutronCommand): self.add_known_arguments(parser) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)', parsed_args) self.set_extra_attrs(parsed_args) neutron_client = self.get_client() diff --git a/neutronclient/neutron/v2_0/agentscheduler.py b/neutronclient/neutron/v2_0/agentscheduler.py index 24287b7..dacfab8 100644 --- a/neutronclient/neutron/v2_0/agentscheduler.py +++ b/neutronclient/neutron/v2_0/agentscheduler.py @@ -40,7 +40,7 @@ class AddNetworkToDhcpAgent(neutronV20.NeutronCommand): help=_('Network to add.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _net_id = neutronV20.find_resourceid_by_name_or_id( @@ -66,7 +66,7 @@ class RemoveNetworkFromDhcpAgent(neutronV20.NeutronCommand): help=_('Network to remove.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _net_id = neutronV20.find_resourceid_by_name_or_id( @@ -142,7 +142,7 @@ class AddRouterToL3Agent(neutronV20.NeutronCommand): help=_('Router to add.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _id = neutronV20.find_resourceid_by_name_or_id( @@ -168,7 +168,7 @@ class RemoveRouterFromL3Agent(neutronV20.NeutronCommand): help=_('Router to remove.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _id = neutronV20.find_resourceid_by_name_or_id( diff --git a/neutronclient/neutron/v2_0/bgp/speaker.py b/neutronclient/neutron/v2_0/bgp/speaker.py index f2a3df7..1a70734 100755 --- a/neutronclient/neutron/v2_0/bgp/speaker.py +++ b/neutronclient/neutron/v2_0/bgp/speaker.py @@ -153,7 +153,7 @@ class AddPeerToSpeaker(neutronv20.NeutronCommand): help=_('ID or name of the BGP peer to add.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() _speaker_id = get_bgp_speaker_id(neutron_client, parsed_args.bgp_speaker) @@ -182,7 +182,7 @@ class RemovePeerFromSpeaker(neutronv20.NeutronCommand): help=_('ID or name of the BGP peer to remove.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() _speaker_id = get_bgp_speaker_id(neutron_client, parsed_args.bgp_speaker) @@ -211,7 +211,7 @@ class AddNetworkToSpeaker(neutronv20.NeutronCommand): help=_('ID or name of the network to add.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() _speaker_id = get_bgp_speaker_id(neutron_client, parsed_args.bgp_speaker) @@ -239,7 +239,7 @@ class RemoveNetworkFromSpeaker(neutronv20.NeutronCommand): help=_('ID or name of the network to remove.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() _speaker_id = get_bgp_speaker_id(neutron_client, parsed_args.bgp_speaker) diff --git a/neutronclient/neutron/v2_0/flavor/flavor.py b/neutronclient/neutron/v2_0/flavor/flavor.py index 30e3ae4..57ec8fa 100644 --- a/neutronclient/neutron/v2_0/flavor/flavor.py +++ b/neutronclient/neutron/v2_0/flavor/flavor.py @@ -118,7 +118,7 @@ class AssociateFlavor(neutronV20.NeutronCommand): 'flavor.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() flavor_id = neutronV20.find_resourceid_by_name_or_id( neutron_client, 'flavor', parsed_args.flavor) @@ -151,7 +151,7 @@ class DisassociateFlavor(neutronV20.NeutronCommand): 'flavor.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() flavor_id = neutronV20.find_resourceid_by_name_or_id( neutron_client, 'flavor', parsed_args.flavor) diff --git a/neutronclient/neutron/v2_0/floatingip.py b/neutronclient/neutron/v2_0/floatingip.py index e361a29..f208896 100644 --- a/neutronclient/neutron/v2_0/floatingip.py +++ b/neutronclient/neutron/v2_0/floatingip.py @@ -115,7 +115,7 @@ class AssociateFloatingIP(neutronV20.NeutronCommand): help=argparse.SUPPRESS) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() update_dict = {} @@ -139,7 +139,7 @@ class DisassociateFloatingIP(neutronV20.NeutronCommand): help=_('ID of the floating IP to disassociate.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() neutron_client.update_floatingip(parsed_args.floatingip_id, diff --git a/neutronclient/neutron/v2_0/fw/firewallpolicy.py b/neutronclient/neutron/v2_0/fw/firewallpolicy.py index 08d623a..a01fc72 100644 --- a/neutronclient/neutron/v2_0/fw/firewallpolicy.py +++ b/neutronclient/neutron/v2_0/fw/firewallpolicy.py @@ -179,7 +179,7 @@ class FirewallPolicyInsertRule(neutronv20.UpdateCommand): self.add_known_arguments(parser) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() body = self.args2body(parsed_args) _id = neutronv20.find_resourceid_by_name_or_id(neutron_client, @@ -217,7 +217,7 @@ class FirewallPolicyRemoveRule(neutronv20.UpdateCommand): self.add_known_arguments(parser) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() body = self.args2body(parsed_args) _id = neutronv20.find_resourceid_by_name_or_id(neutron_client, diff --git a/neutronclient/neutron/v2_0/lb/healthmonitor.py b/neutronclient/neutron/v2_0/lb/healthmonitor.py index ee5d70b..6fea0a1 100644 --- a/neutronclient/neutron/v2_0/lb/healthmonitor.py +++ b/neutronclient/neutron/v2_0/lb/healthmonitor.py @@ -124,7 +124,7 @@ class AssociateHealthMonitor(neutronV20.NeutronCommand): help=_('ID of the pool to be associated with the health monitor.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() body = {'health_monitor': {'id': parsed_args.health_monitor_id}} pool_id = neutronV20.find_resourceid_by_name_or_id( @@ -150,7 +150,7 @@ class DisassociateHealthMonitor(neutronV20.NeutronCommand): help=_('ID of the pool to be associated with the health monitor.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() pool_id = neutronV20.find_resourceid_by_name_or_id( neutron_client, 'pool', parsed_args.pool_id) diff --git a/neutronclient/neutron/v2_0/nsx/networkgateway.py b/neutronclient/neutron/v2_0/nsx/networkgateway.py index 46d83e9..c7df513 100644 --- a/neutronclient/neutron/v2_0/nsx/networkgateway.py +++ b/neutronclient/neutron/v2_0/nsx/networkgateway.py @@ -234,7 +234,7 @@ class NetworkGatewayInterfaceCommand(neutronV20.NeutronCommand): class ConnectNetworkGateway(NetworkGatewayInterfaceCommand): """Add an internal network interface to a router.""" - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() (gateway_id, network_id) = self.retrieve_ids(neutron_client, @@ -252,7 +252,7 @@ class ConnectNetworkGateway(NetworkGatewayInterfaceCommand): class DisconnectNetworkGateway(NetworkGatewayInterfaceCommand): """Remove a network from a network gateway.""" - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() (gateway_id, network_id) = self.retrieve_ids(neutron_client, diff --git a/neutronclient/neutron/v2_0/purge.py b/neutronclient/neutron/v2_0/purge.py index 6d8e9d9..6176296 100644 --- a/neutronclient/neutron/v2_0/purge.py +++ b/neutronclient/neutron/v2_0/purge.py @@ -125,7 +125,7 @@ class Purge(neutronV20.NeutronCommand): help=_('ID of Tenant owning the resources to be deleted.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): neutron_client = self.get_client() self.any_failures = False diff --git a/neutronclient/neutron/v2_0/quota.py b/neutronclient/neutron/v2_0/quota.py index a88f0c6..985e619 100644 --- a/neutronclient/neutron/v2_0/quota.py +++ b/neutronclient/neutron/v2_0/quota.py @@ -52,7 +52,7 @@ class DeleteQuota(neutronV20.NeutronCommand): help=argparse.SUPPRESS, nargs='?') return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() tenant_id = get_tenant_id(parsed_args, neutron_client) diff --git a/neutronclient/neutron/v2_0/router.py b/neutronclient/neutron/v2_0/router.py index c372f98..76022e7 100644 --- a/neutronclient/neutron/v2_0/router.py +++ b/neutronclient/neutron/v2_0/router.py @@ -161,7 +161,7 @@ class RouterInterfaceCommand(neutronV20.NeutronCommand): 'subnet.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() @@ -236,7 +236,7 @@ class SetGatewayRouter(neutronV20.NeutronCommand): 'You can repeat this option.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _router_id = neutronV20.find_resourceid_by_name_or_id( @@ -273,7 +273,7 @@ class RemoveGatewayRouter(neutronV20.NeutronCommand): help=_('ID or name of the router.')) return parser - def run(self, parsed_args): + def take_action(self, parsed_args): self.log.debug('run(%s)' % parsed_args) neutron_client = self.get_client() _router_id = neutronV20.find_resourceid_by_name_or_id( |