summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v1
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/volume/v1')
-rw-r--r--openstackclient/volume/v1/backup.py27
-rw-r--r--openstackclient/volume/v1/qos_specs.py36
-rw-r--r--openstackclient/volume/v1/snapshot.py30
-rw-r--r--openstackclient/volume/v1/volume.py30
-rw-r--r--openstackclient/volume/v1/volume_type.py30
5 files changed, 20 insertions, 133 deletions
diff --git a/openstackclient/volume/v1/backup.py b/openstackclient/volume/v1/backup.py
index 4f2ff8bb..32f39fb5 100644
--- a/openstackclient/volume/v1/backup.py
+++ b/openstackclient/volume/v1/backup.py
@@ -16,21 +16,15 @@
"""Volume v1 Backup action implementations"""
import copy
-import logging
import six
-from cliff import command
-from cliff import lister
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import utils
-class CreateBackup(show.ShowOne):
+class CreateBackup(command.ShowOne):
"""Create new backup"""
- log = logging.getLogger(__name__ + '.CreateBackup')
-
def get_parser(self, prog_name):
parser = super(CreateBackup, self).get_parser(prog_name)
parser.add_argument(
@@ -57,7 +51,6 @@ class CreateBackup(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_id = utils.find_resource(volume_client.volumes,
@@ -76,8 +69,6 @@ class CreateBackup(show.ShowOne):
class DeleteBackup(command.Command):
"""Delete backup(s)"""
- log = logging.getLogger(__name__ + '.DeleteBackup')
-
def get_parser(self, prog_name):
parser = super(DeleteBackup, self).get_parser(prog_name)
parser.add_argument(
@@ -88,7 +79,6 @@ class DeleteBackup(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for backup in parsed_args.backups:
@@ -97,11 +87,9 @@ class DeleteBackup(command.Command):
volume_client.backups.delete(backup_id)
-class ListBackup(lister.Lister):
+class ListBackup(command.Lister):
"""List backups"""
- log = logging.getLogger(__name__ + '.ListBackup')
-
def get_parser(self, prog_name):
parser = super(ListBackup, self).get_parser(prog_name)
parser.add_argument(
@@ -112,7 +100,6 @@ class ListBackup(lister.Lister):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
def _format_volume_id(volume_id):
@@ -157,8 +144,6 @@ class ListBackup(lister.Lister):
class RestoreBackup(command.Command):
"""Restore backup"""
- log = logging.getLogger(__name__ + '.RestoreBackup')
-
def get_parser(self, prog_name):
parser = super(RestoreBackup, self).get_parser(prog_name)
parser.add_argument(
@@ -171,7 +156,6 @@ class RestoreBackup(command.Command):
help='Volume to restore to (name or ID)')
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
backup = utils.find_resource(volume_client.backups,
@@ -182,11 +166,9 @@ class RestoreBackup(command.Command):
destination_volume.id)
-class ShowBackup(show.ShowOne):
+class ShowBackup(command.ShowOne):
"""Display backup details"""
- log = logging.getLogger(__name__ + '.ShowBackup')
-
def get_parser(self, prog_name):
parser = super(ShowBackup, self).get_parser(prog_name)
parser.add_argument(
@@ -195,7 +177,6 @@ class ShowBackup(show.ShowOne):
help='Backup to display (ID only)')
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
backup = utils.find_resource(volume_client.backups,
diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py
index 73e70a21..826e5c49 100644
--- a/openstackclient/volume/v1/qos_specs.py
+++ b/openstackclient/volume/v1/qos_specs.py
@@ -15,13 +15,9 @@
"""Volume v1 QoS action implementations"""
-import logging
import six
-from cliff import command
-from cliff import lister
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
@@ -29,8 +25,6 @@ from openstackclient.common import utils
class AssociateQos(command.Command):
"""Associate a QoS specification to a volume type"""
- log = logging.getLogger(__name__ + '.AssociateQos')
-
def get_parser(self, prog_name):
parser = super(AssociateQos, self).get_parser(prog_name)
parser.add_argument(
@@ -45,7 +39,6 @@ class AssociateQos(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_spec = utils.find_resource(volume_client.qos_specs,
@@ -56,11 +49,9 @@ class AssociateQos(command.Command):
volume_client.qos_specs.associate(qos_spec.id, volume_type.id)
-class CreateQos(show.ShowOne):
+class CreateQos(command.ShowOne):
"""Create new QoS specification"""
- log = logging.getLogger(__name__ + '.CreateQos')
-
def get_parser(self, prog_name):
parser = super(CreateQos, self).get_parser(prog_name)
parser.add_argument(
@@ -86,7 +77,6 @@ class CreateQos(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
specs = {}
@@ -103,8 +93,6 @@ class CreateQos(show.ShowOne):
class DeleteQos(command.Command):
"""Delete QoS specification"""
- log = logging.getLogger(__name__ + '.DeleteQos')
-
def get_parser(self, prog_name):
parser = super(DeleteQos, self).get_parser(prog_name)
parser.add_argument(
@@ -115,7 +103,6 @@ class DeleteQos(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for qos in parsed_args.qos_specs:
@@ -126,8 +113,6 @@ class DeleteQos(command.Command):
class DisassociateQos(command.Command):
"""Disassociate a QoS specification from a volume type"""
- log = logging.getLogger(__name__ + '.DisassociateQos')
-
def get_parser(self, prog_name):
parser = super(DisassociateQos, self).get_parser(prog_name)
parser.add_argument(
@@ -150,7 +135,6 @@ class DisassociateQos(command.Command):
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_spec = utils.find_resource(volume_client.qos_specs,
@@ -164,12 +148,9 @@ class DisassociateQos(command.Command):
volume_client.qos_specs.disassociate_all(qos_spec.id)
-class ListQos(lister.Lister):
+class ListQos(command.Lister):
"""List QoS specifications"""
- log = logging.getLogger(__name__ + '.ListQos')
-
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_specs_list = volume_client.qos_specs.list()
@@ -195,8 +176,6 @@ class ListQos(lister.Lister):
class SetQos(command.Command):
"""Set QoS specification properties"""
- log = logging.getLogger(__name__ + '.SetQos')
-
def get_parser(self, prog_name):
parser = super(SetQos, self).get_parser(prog_name)
parser.add_argument(
@@ -213,7 +192,6 @@ class SetQos(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_spec = utils.find_resource(volume_client.qos_specs,
@@ -226,11 +204,9 @@ class SetQos(command.Command):
self.app.log.error("No changes requested\n")
-class ShowQos(show.ShowOne):
+class ShowQos(command.ShowOne):
"""Display QoS specification details"""
- log = logging.getLogger(__name__ + '.ShowQos')
-
def get_parser(self, prog_name):
parser = super(ShowQos, self).get_parser(prog_name)
parser.add_argument(
@@ -240,7 +216,6 @@ class ShowQos(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_spec = utils.find_resource(volume_client.qos_specs,
@@ -261,8 +236,6 @@ class ShowQos(show.ShowOne):
class UnsetQos(command.Command):
"""Unset QoS specification properties"""
- log = logging.getLogger(__name__ + '.SetQos')
-
def get_parser(self, prog_name):
parser = super(UnsetQos, self).get_parser(prog_name)
parser.add_argument(
@@ -280,7 +253,6 @@ class UnsetQos(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
qos_spec = utils.find_resource(volume_client.qos_specs,
diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v1/snapshot.py
index 24379a9a..95200e40 100644
--- a/openstackclient/volume/v1/snapshot.py
+++ b/openstackclient/volume/v1/snapshot.py
@@ -16,22 +16,16 @@
"""Volume v1 Snapshot action implementations"""
import copy
-import logging
import six
-from cliff import command
-from cliff import lister
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
-class CreateSnapshot(show.ShowOne):
+class CreateSnapshot(command.ShowOne):
"""Create new snapshot"""
- log = logging.getLogger(__name__ + '.CreateSnapshot')
-
def get_parser(self, prog_name):
parser = super(CreateSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -59,7 +53,6 @@ class CreateSnapshot(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_id = utils.find_resource(volume_client.volumes,
@@ -81,8 +74,6 @@ class CreateSnapshot(show.ShowOne):
class DeleteSnapshot(command.Command):
"""Delete snapshot(s)"""
- log = logging.getLogger(__name__ + '.DeleteSnapshot')
-
def get_parser(self, prog_name):
parser = super(DeleteSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -93,7 +84,6 @@ class DeleteSnapshot(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for snapshot in parsed_args.snapshots:
@@ -102,11 +92,9 @@ class DeleteSnapshot(command.Command):
volume_client.volume_snapshots.delete(snapshot_id)
-class ListSnapshot(lister.Lister):
+class ListSnapshot(command.Lister):
"""List snapshots"""
- log = logging.getLogger(__name__ + '.ListSnapshot')
-
def get_parser(self, prog_name):
parser = super(ListSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -123,7 +111,6 @@ class ListSnapshot(lister.Lister):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
def _format_volume_id(volume_id):
@@ -179,8 +166,6 @@ class ListSnapshot(lister.Lister):
class SetSnapshot(command.Command):
"""Set snapshot properties"""
- log = logging.getLogger(__name__ + '.SetSnapshot')
-
def get_parser(self, prog_name):
parser = super(SetSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -204,7 +189,6 @@ class SetSnapshot(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
snapshot = utils.find_resource(volume_client.volume_snapshots,
@@ -227,11 +211,9 @@ class SetSnapshot(command.Command):
snapshot.update(**kwargs)
-class ShowSnapshot(show.ShowOne):
+class ShowSnapshot(command.ShowOne):
"""Display snapshot details"""
- log = logging.getLogger(__name__ + '.ShowSnapshot')
-
def get_parser(self, prog_name):
parser = super(ShowSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -240,7 +222,6 @@ class ShowSnapshot(show.ShowOne):
help='Snapshot to display (name or ID)')
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
snapshot = utils.find_resource(volume_client.volume_snapshots,
@@ -256,8 +237,6 @@ class ShowSnapshot(show.ShowOne):
class UnsetSnapshot(command.Command):
"""Unset snapshot properties"""
- log = logging.getLogger(__name__ + '.UnsetSnapshot')
-
def get_parser(self, prog_name):
parser = super(UnsetSnapshot, self).get_parser(prog_name)
parser.add_argument(
@@ -276,7 +255,6 @@ class UnsetSnapshot(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
snapshot = utils.find_resource(
diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py
index 17b6c9c8..90827d20 100644
--- a/openstackclient/volume/v1/volume.py
+++ b/openstackclient/volume/v1/volume.py
@@ -16,22 +16,16 @@
"""Volume v1 Volume action implementations"""
import argparse
-import logging
import six
-from cliff import command
-from cliff import lister
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
-class CreateVolume(show.ShowOne):
+class CreateVolume(command.ShowOne):
"""Create new volume"""
- log = logging.getLogger(__name__ + '.CreateVolume')
-
def get_parser(self, prog_name):
parser = super(CreateVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -102,7 +96,6 @@ class CreateVolume(show.ShowOne):
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
identity_client = self.app.client_manager.identity
@@ -166,8 +159,6 @@ class CreateVolume(show.ShowOne):
class DeleteVolume(command.Command):
"""Delete volume(s)"""
- log = logging.getLogger(__name__ + '.DeleteVolume')
-
def get_parser(self, prog_name):
parser = super(DeleteVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -186,7 +177,6 @@ class DeleteVolume(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
for volume in parsed_args.volumes:
@@ -198,11 +188,9 @@ class DeleteVolume(command.Command):
volume_client.volumes.delete(volume_obj.id)
-class ListVolume(lister.Lister):
+class ListVolume(command.Lister):
"""List volumes"""
- log = logging.getLogger(__name__ + '.ListVolume')
-
def get_parser(self, prog_name):
parser = super(ListVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -229,7 +217,6 @@ class ListVolume(lister.Lister):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
@@ -316,8 +303,6 @@ class ListVolume(lister.Lister):
class SetVolume(command.Command):
"""Set volume properties"""
- log = logging.getLogger(__name__ + '.SetVolume')
-
def get_parser(self, prog_name):
parser = super(SetVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -350,7 +335,6 @@ class SetVolume(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume = utils.find_resource(volume_client.volumes, parsed_args.volume)
@@ -382,11 +366,9 @@ class SetVolume(command.Command):
self.app.log.error("No changes requested\n")
-class ShowVolume(show.ShowOne):
+class ShowVolume(command.ShowOne):
"""Show volume details"""
- log = logging.getLogger(__name__ + '.ShowVolume')
-
def get_parser(self, prog_name):
parser = super(ShowVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -396,7 +378,6 @@ class ShowVolume(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume = utils.find_resource(volume_client.volumes, parsed_args.volume)
@@ -418,8 +399,6 @@ class ShowVolume(show.ShowOne):
class UnsetVolume(command.Command):
"""Unset volume properties"""
- log = logging.getLogger(__name__ + '.UnsetVolume')
-
def get_parser(self, prog_name):
parser = super(UnsetVolume, self).get_parser(prog_name)
parser.add_argument(
@@ -438,7 +417,6 @@ class UnsetVolume(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume = utils.find_resource(
diff --git a/openstackclient/volume/v1/volume_type.py b/openstackclient/volume/v1/volume_type.py
index b664adfb..24d0b235 100644
--- a/openstackclient/volume/v1/volume_type.py
+++ b/openstackclient/volume/v1/volume_type.py
@@ -15,22 +15,16 @@
"""Volume v1 Type action implementations"""
-import logging
import six
-from cliff import command
-from cliff import lister
-from cliff import show
-
+from openstackclient.common import command
from openstackclient.common import parseractions
from openstackclient.common import utils
-class CreateVolumeType(show.ShowOne):
+class CreateVolumeType(command.ShowOne):
"""Create new volume type"""
- log = logging.getLogger(__name__ + '.CreateVolumeType')
-
def get_parser(self, prog_name):
parser = super(CreateVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -47,7 +41,6 @@ class CreateVolumeType(show.ShowOne):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_type = volume_client.volume_types.create(parsed_args.name)
@@ -64,8 +57,6 @@ class CreateVolumeType(show.ShowOne):
class DeleteVolumeType(command.Command):
"""Delete volume type"""
- log = logging.getLogger(__name__ + '.DeleteVolumeType')
-
def get_parser(self, prog_name):
parser = super(DeleteVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -75,7 +66,6 @@ class DeleteVolumeType(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_type_id = utils.find_resource(
@@ -83,11 +73,9 @@ class DeleteVolumeType(command.Command):
volume_client.volume_types.delete(volume_type_id)
-class ListVolumeType(lister.Lister):
+class ListVolumeType(command.Lister):
"""List volume types"""
- log = logging.getLogger(__name__ + '.ListVolumeType')
-
def get_parser(self, prog_name):
parser = super(ListVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -97,7 +85,6 @@ class ListVolumeType(lister.Lister):
help='List additional fields in output')
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
if parsed_args.long:
columns = ('ID', 'Name', 'Extra Specs')
@@ -116,8 +103,6 @@ class ListVolumeType(lister.Lister):
class SetVolumeType(command.Command):
"""Set volume type properties"""
- log = logging.getLogger(__name__ + '.SetVolumeType')
-
def get_parser(self, prog_name):
parser = super(SetVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -134,7 +119,6 @@ class SetVolumeType(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_type = utils.find_resource(
@@ -147,8 +131,6 @@ class SetVolumeType(command.Command):
class UnsetVolumeType(command.Command):
"""Unset volume type properties"""
- log = logging.getLogger(__name__ + '.UnsetVolumeType')
-
def get_parser(self, prog_name):
parser = super(UnsetVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -167,7 +149,6 @@ class UnsetVolumeType(command.Command):
)
return parser
- @utils.log_method(log)
def take_action(self, parsed_args):
volume_client = self.app.client_manager.volume
volume_type = utils.find_resource(
@@ -181,11 +162,9 @@ class UnsetVolumeType(command.Command):
self.app.log.error("No changes requested\n")
-class ShowVolumeType(show.ShowOne):
+class ShowVolumeType(command.ShowOne):
"""Display volume type details"""
- log = logging.getLogger(__name__ + ".ShowVolumeType")
-
def get_parser(self, prog_name):
parser = super(ShowVolumeType, self).get_parser(prog_name)
parser.add_argument(
@@ -196,7 +175,6 @@ class ShowVolumeType(show.ShowOne):
return parser
def take_action(self, parsed_args):
- self.log.debug("take_action: (%s)", parsed_args)
volume_client = self.app.client_manager.volume
volume_type = utils.find_resource(
volume_client.volume_types, parsed_args.volume_type)