Commit f51df8b3 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Rename classes _id/name_filter --> [ID/Name]Filter

Both classes are located in kamaki.cli.cmds
parent a0677c5c
......@@ -92,9 +92,9 @@ class CommandInit(object):
arguments.update(self.arguments)
if isinstance(self, OptionalOutput):
arguments.update(self.oo_arguments)
if isinstance(self, _name_filter):
if isinstance(self, NameFilter):
arguments.update(self.nf_arguments)
if isinstance(self, _id_filter):
if isinstance(self, IDFilter):
arguments.update(self.if_arguments)
try:
arguments.update(self.wait_arguments)
......@@ -310,7 +310,7 @@ class OptionalOutput(object):
print_method(output, **print_method_kwargs)
class _name_filter(object):
class NameFilter(object):
nf_arguments = dict(
name=ValueArgument('filter by name', '--name'),
......@@ -340,7 +340,7 @@ class _name_filter(object):
return self._non_exact_name_filter(self._exact_name_filter(items))
class _id_filter(object):
class IDFilter(object):
if_arguments = dict(
id=ValueArgument('filter by id', '--id'),
......
......@@ -37,7 +37,7 @@ from os.path import abspath
from kamaki.cli import command
from kamaki.clients.astakos import LoggedAstakosClient
from kamaki.cli.cmds import (
CommandInit, errors, OptionalOutput, addLogSettings, _name_filter)
CommandInit, NameFilter, OptionalOutput, errors, addLogSettings)
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.errors import (
CLIBaseUrlError, CLISyntaxError, CLIError, CLIInvalidArgument)
......@@ -575,8 +575,7 @@ class resource_list(_init_synnefo_astakosclient, OptionalOutput):
@command(endpoint_commands)
class endpoint_list(
_init_synnefo_astakosclient, OptionalOutput, _name_filter):
class endpoint_list(_init_synnefo_astakosclient, OptionalOutput, NameFilter):
"""Get endpoints service endpoints"""
arguments = dict(endpoint_type=ValueArgument('Filter by type', '--type'))
......
......@@ -47,8 +47,8 @@ from kamaki.cli.argument import (
FlagArgument, ValueArgument, KeyValueArgument, RepeatableArgument,
ProgressBarArgument, DateArgument, IntArgument, StatusArgument)
from kamaki.cli.cmds import (
CommandInit, errors, addLogSettings, dataModification, OptionalOutput,
_name_filter, _id_filter)
CommandInit, dataModification, OptionalOutput, NameFilter, IDFilter,
errors, addLogSettings, )
server_cmds = CommandTree('server', 'Cyclades/Compute API server commands')
......@@ -152,7 +152,7 @@ class _init_cyclades(CommandInit):
@command(server_cmds)
class server_list(_init_cyclades, OptionalOutput, _name_filter, _id_filter):
class server_list(_init_cyclades, OptionalOutput, NameFilter, IDFilter):
"""List virtual servers accessible by user
Use filtering arguments (e.g., --name-like) to manage long server lists
"""
......@@ -844,7 +844,7 @@ class server_wait(_init_cyclades, _server_wait):
@command(flavor_cmds)
class flavor_list(_init_cyclades, OptionalOutput, _name_filter, _id_filter):
class flavor_list(_init_cyclades, OptionalOutput, NameFilter, IDFilter):
"""List available hardware flavors"""
PERMANENTS = ('id', 'name')
......
......@@ -49,8 +49,7 @@ from kamaki.cli.argument import (
from kamaki.cli.cmds.cyclades import _init_cyclades
from kamaki.cli.errors import CLIError, raiseCLIError, CLIInvalidArgument
from kamaki.cli.cmds import (
CommandInit, errors, addLogSettings, OptionalOutput, _name_filter,
_id_filter)
CommandInit, errors, addLogSettings, OptionalOutput, NameFilter, IDFilter)
image_cmds = CommandTree('image', 'Cyclades/Plankton API image commands')
......@@ -158,7 +157,7 @@ def _validate_image_location(location):
@command(image_cmds)
class image_list(_init_image, OptionalOutput, _name_filter, _id_filter):
class image_list(_init_image, OptionalOutput, NameFilter, IDFilter):
"""List images accessible by user"""
PERMANENTS = (
......@@ -621,8 +620,7 @@ class image_unregister(_init_image):
# Compute Image Commands
@command(imagecompute_cmds)
class imagecompute_list(
_init_cyclades, OptionalOutput, _name_filter, _id_filter):
class imagecompute_list(_init_cyclades, OptionalOutput, NameFilter, IDFilter):
"""List images"""
PERMANENTS = ('id', 'name')
......
......@@ -44,8 +44,7 @@ from kamaki.cli.argument import (
FlagArgument, ValueArgument, RepeatableArgument, IntArgument,
StatusArgument)
from kamaki.cli.cmds import (
CommandInit, errors, addLogSettings, OptionalOutput, _name_filter,
_id_filter)
CommandInit, OptionalOutput, NameFilter, IDFilter, errors, addLogSettings)
from kamaki.cli.cmds.cyclades import _service_wait
......@@ -87,7 +86,7 @@ class _init_network(CommandInit):
@command(network_cmds)
class network_list(_init_network, OptionalOutput, _name_filter, _id_filter):
class network_list(_init_network, OptionalOutput, NameFilter, IDFilter):
"""List networks
Use filtering arguments (e.g., --name-like) to manage long server lists
"""
......@@ -248,7 +247,7 @@ class network_modify(_init_network, OptionalOutput):
@command(subnet_cmds)
class subnet_list(_init_network, OptionalOutput, _name_filter, _id_filter):
class subnet_list(_init_network, OptionalOutput, NameFilter, IDFilter):
"""List subnets
Use filtering arguments (e.g., --name-like) to manage long server lists
"""
......@@ -378,7 +377,7 @@ class subnet_modify(_init_network, OptionalOutput):
@command(port_cmds)
class port_list(_init_network, OptionalOutput, _name_filter, _id_filter):
class port_list(_init_network, OptionalOutput, NameFilter, IDFilter):
"""List all ports"""
arguments = dict(
......
......@@ -41,8 +41,8 @@ from kamaki.clients.pithos import PithosClient, ClientError
from kamaki.cli import command
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.cmds import (
CommandInit, errors, addLogSettings, DontRaiseKeyError, OptionalOutput,
_name_filter)
CommandInit, DontRaiseKeyError, OptionalOutput, NameFilter, errors,
addLogSettings)
from kamaki.cli.errors import (
CLIBaseUrlError, CLIError, CLIInvalidArgument, raiseCLIError,
CLISyntaxError)
......@@ -241,7 +241,7 @@ class file_info(_pithos_container, OptionalOutput):
@command(file_cmds)
class file_list(_pithos_container, OptionalOutput, _name_filter):
class file_list(_pithos_container, OptionalOutput, NameFilter):
"""List all objects in a container or a directory object"""
arguments = dict(
......@@ -1418,7 +1418,7 @@ class container_modify(_pithos_account, OptionalOutput):
@command(container_cmds)
class container_list(_pithos_account, OptionalOutput, _name_filter):
class container_list(_pithos_account, OptionalOutput, NameFilter):
"""List all containers, or their contents"""
arguments = dict(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment