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
This commit is contained in:
@@ -384,9 +384,6 @@ class NeutronCommandMeta(abc.ABCMeta):
|
|||||||
@six.add_metaclass(NeutronCommandMeta)
|
@six.add_metaclass(NeutronCommandMeta)
|
||||||
class NeutronCommand(command.Command):
|
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 = []
|
values_specs = []
|
||||||
json_indent = None
|
json_indent = None
|
||||||
resource = None
|
resource = None
|
||||||
@@ -456,7 +453,6 @@ class NeutronCommand(command.Command):
|
|||||||
class CreateCommand(NeutronCommand, show.ShowOne):
|
class CreateCommand(NeutronCommand, show.ShowOne):
|
||||||
"""Create a resource for a given tenant."""
|
"""Create a resource for a given tenant."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
log = None
|
log = None
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
@@ -498,7 +494,6 @@ class CreateCommand(NeutronCommand, show.ShowOne):
|
|||||||
class UpdateCommand(NeutronCommand):
|
class UpdateCommand(NeutronCommand):
|
||||||
"""Update resource's information."""
|
"""Update resource's information."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
|
|
||||||
@@ -553,7 +548,6 @@ class UpdateCommand(NeutronCommand):
|
|||||||
class DeleteCommand(NeutronCommand):
|
class DeleteCommand(NeutronCommand):
|
||||||
"""Delete a given resource."""
|
"""Delete a given resource."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
|
|
||||||
@@ -599,7 +593,6 @@ class DeleteCommand(NeutronCommand):
|
|||||||
class ListCommand(NeutronCommand, lister.Lister):
|
class ListCommand(NeutronCommand, lister.Lister):
|
||||||
"""List resources that belong to a given tenant."""
|
"""List resources that belong to a given tenant."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
log = None
|
log = None
|
||||||
_formatters = {}
|
_formatters = {}
|
||||||
list_columns = []
|
list_columns = []
|
||||||
@@ -705,7 +698,6 @@ class ListCommand(NeutronCommand, lister.Lister):
|
|||||||
class ShowCommand(NeutronCommand, show.ShowOne):
|
class ShowCommand(NeutronCommand, show.ShowOne):
|
||||||
"""Show information of a given resource."""
|
"""Show information of a given resource."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
|
|
||||||
|
@@ -90,7 +90,6 @@ class DeleteFloatingIP(neutronV20.DeleteCommand):
|
|||||||
class AssociateFloatingIP(neutronV20.NeutronCommand):
|
class AssociateFloatingIP(neutronV20.NeutronCommand):
|
||||||
"""Create a mapping between a floating IP and a fixed IP."""
|
"""Create a mapping between a floating IP and a fixed IP."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'floatingip'
|
resource = 'floatingip'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
@@ -126,7 +125,6 @@ class AssociateFloatingIP(neutronV20.NeutronCommand):
|
|||||||
class DisassociateFloatingIP(neutronV20.NeutronCommand):
|
class DisassociateFloatingIP(neutronV20.NeutronCommand):
|
||||||
"""Remove a mapping from a floating IP to a fixed IP."""
|
"""Remove a mapping from a floating IP to a fixed IP."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'floatingip'
|
resource = 'floatingip'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
|
@@ -37,7 +37,6 @@ def get_tenant_id(args, client):
|
|||||||
class DeleteQuota(neutronV20.NeutronCommand):
|
class DeleteQuota(neutronV20.NeutronCommand):
|
||||||
"""Delete defined quotas of a given tenant."""
|
"""Delete defined quotas of a given tenant."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'quota'
|
resource = 'quota'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
@@ -70,7 +69,6 @@ class DeleteQuota(neutronV20.NeutronCommand):
|
|||||||
class ListQuota(neutronV20.NeutronCommand, lister.Lister):
|
class ListQuota(neutronV20.NeutronCommand, lister.Lister):
|
||||||
"""List quotas of all tenants who have non-default quota values."""
|
"""List quotas of all tenants who have non-default quota values."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'quota'
|
resource = 'quota'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
@@ -98,7 +96,6 @@ class ShowQuota(neutronV20.NeutronCommand, show.ShowOne):
|
|||||||
"""Show quotas of a given tenant.
|
"""Show quotas of a given tenant.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
api = 'network'
|
|
||||||
resource = "quota"
|
resource = "quota"
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
|
@@ -138,7 +138,6 @@ class UpdateRouter(neutronV20.UpdateCommand):
|
|||||||
class RouterInterfaceCommand(neutronV20.NeutronCommand):
|
class RouterInterfaceCommand(neutronV20.NeutronCommand):
|
||||||
"""Based class to Add/Remove router interface."""
|
"""Based class to Add/Remove router interface."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'router'
|
resource = 'router'
|
||||||
|
|
||||||
def call_api(self, neutron_client, router_id, body):
|
def call_api(self, neutron_client, router_id, body):
|
||||||
@@ -211,7 +210,6 @@ class RemoveInterfaceRouter(RouterInterfaceCommand):
|
|||||||
class SetGatewayRouter(neutronV20.NeutronCommand):
|
class SetGatewayRouter(neutronV20.NeutronCommand):
|
||||||
"""Set the external network gateway for a router."""
|
"""Set the external network gateway for a router."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'router'
|
resource = 'router'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
@@ -264,7 +262,6 @@ class SetGatewayRouter(neutronV20.NeutronCommand):
|
|||||||
class RemoveGatewayRouter(neutronV20.NeutronCommand):
|
class RemoveGatewayRouter(neutronV20.NeutronCommand):
|
||||||
"""Remove an external network gateway from a router."""
|
"""Remove an external network gateway from a router."""
|
||||||
|
|
||||||
api = 'network'
|
|
||||||
resource = 'router'
|
resource = 'router'
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
def get_parser(self, prog_name):
|
||||||
|
Reference in New Issue
Block a user