From 2eb5b71c074805de2ca2a23c04be653ca8675410 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 8 Jan 2016 23:01:36 +0900 Subject: [PATCH] refactor: Drop meaningless 'api' attribute from NeutronCommand class 'api' attribute in NeutronCommand class was required by OpenStackCommand class. It is now meaningless. Partial-Bug: #1532258 Change-Id: I7fa24cc1011e5ee0ce1c8956edae785cfb4b9408 --- neutronclient/neutron/v2_0/__init__.py | 8 -------- neutronclient/neutron/v2_0/floatingip.py | 2 -- neutronclient/neutron/v2_0/quota.py | 3 --- neutronclient/neutron/v2_0/router.py | 3 --- 4 files changed, 16 deletions(-) diff --git a/neutronclient/neutron/v2_0/__init__.py b/neutronclient/neutron/v2_0/__init__.py index 3aeb26a44..80c0131ce 100644 --- a/neutronclient/neutron/v2_0/__init__.py +++ b/neutronclient/neutron/v2_0/__init__.py @@ -384,9 +384,6 @@ class NeutronCommandMeta(abc.ABCMeta): @six.add_metaclass(NeutronCommandMeta) class NeutronCommand(command.Command): - # TODO(amotoki): Get rid of 'api' attribute. There is no such convention - # in OpenStack client. It may be an ancient convention though. - api = 'network' values_specs = [] json_indent = None resource = None @@ -456,7 +453,6 @@ class NeutronCommand(command.Command): class CreateCommand(NeutronCommand, show.ShowOne): """Create a resource for a given tenant.""" - api = 'network' log = None def get_parser(self, prog_name): @@ -498,7 +494,6 @@ class CreateCommand(NeutronCommand, show.ShowOne): class UpdateCommand(NeutronCommand): """Update resource's information.""" - api = 'network' log = None allow_names = True @@ -553,7 +548,6 @@ class UpdateCommand(NeutronCommand): class DeleteCommand(NeutronCommand): """Delete a given resource.""" - api = 'network' log = None allow_names = True @@ -599,7 +593,6 @@ class DeleteCommand(NeutronCommand): class ListCommand(NeutronCommand, lister.Lister): """List resources that belong to a given tenant.""" - api = 'network' log = None _formatters = {} list_columns = [] @@ -705,7 +698,6 @@ class ListCommand(NeutronCommand, lister.Lister): class ShowCommand(NeutronCommand, show.ShowOne): """Show information of a given resource.""" - api = 'network' log = None allow_names = True diff --git a/neutronclient/neutron/v2_0/floatingip.py b/neutronclient/neutron/v2_0/floatingip.py index 44b402ad0..7e634e9da 100644 --- a/neutronclient/neutron/v2_0/floatingip.py +++ b/neutronclient/neutron/v2_0/floatingip.py @@ -90,7 +90,6 @@ class DeleteFloatingIP(neutronV20.DeleteCommand): class AssociateFloatingIP(neutronV20.NeutronCommand): """Create a mapping between a floating IP and a fixed IP.""" - api = 'network' resource = 'floatingip' def get_parser(self, prog_name): @@ -126,7 +125,6 @@ class AssociateFloatingIP(neutronV20.NeutronCommand): class DisassociateFloatingIP(neutronV20.NeutronCommand): """Remove a mapping from a floating IP to a fixed IP.""" - api = 'network' resource = 'floatingip' def get_parser(self, prog_name): diff --git a/neutronclient/neutron/v2_0/quota.py b/neutronclient/neutron/v2_0/quota.py index 4b6e86e0b..2ccc54546 100644 --- a/neutronclient/neutron/v2_0/quota.py +++ b/neutronclient/neutron/v2_0/quota.py @@ -37,7 +37,6 @@ def get_tenant_id(args, client): class DeleteQuota(neutronV20.NeutronCommand): """Delete defined quotas of a given tenant.""" - api = 'network' resource = 'quota' def get_parser(self, prog_name): @@ -70,7 +69,6 @@ class DeleteQuota(neutronV20.NeutronCommand): class ListQuota(neutronV20.NeutronCommand, lister.Lister): """List quotas of all tenants who have non-default quota values.""" - api = 'network' resource = 'quota' def get_parser(self, prog_name): @@ -98,7 +96,6 @@ class ShowQuota(neutronV20.NeutronCommand, show.ShowOne): """Show quotas of a given tenant. """ - api = 'network' resource = "quota" def get_parser(self, prog_name): diff --git a/neutronclient/neutron/v2_0/router.py b/neutronclient/neutron/v2_0/router.py index 4e4066b4b..88da856b3 100644 --- a/neutronclient/neutron/v2_0/router.py +++ b/neutronclient/neutron/v2_0/router.py @@ -138,7 +138,6 @@ class UpdateRouter(neutronV20.UpdateCommand): class RouterInterfaceCommand(neutronV20.NeutronCommand): """Based class to Add/Remove router interface.""" - api = 'network' resource = 'router' def call_api(self, neutron_client, router_id, body): @@ -211,7 +210,6 @@ class RemoveInterfaceRouter(RouterInterfaceCommand): class SetGatewayRouter(neutronV20.NeutronCommand): """Set the external network gateway for a router.""" - api = 'network' resource = 'router' def get_parser(self, prog_name): @@ -264,7 +262,6 @@ class SetGatewayRouter(neutronV20.NeutronCommand): class RemoveGatewayRouter(neutronV20.NeutronCommand): """Remove an external network gateway from a router.""" - api = 'network' resource = 'router' def get_parser(self, prog_name):