summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/common/utils.py6
-rw-r--r--openstackclient/identity/v3/trust.py4
-rw-r--r--openstackclient/image/v2/image.py2
-rw-r--r--openstackclient/object/v1/lib/__init__.py0
-rw-r--r--openstackclient/tests/identity/v3/test_trust.py4
-rw-r--r--openstackclient/volume/v1/snapshot.py1
-rw-r--r--openstackclient/volume/v1/volume.py1
-rw-r--r--openstackclient/volume/v1/volume_type.py (renamed from openstackclient/volume/v1/type.py)25
8 files changed, 35 insertions, 8 deletions
diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py
index 6cd35c05..2f8419f4 100644
--- a/openstackclient/common/utils.py
+++ b/openstackclient/common/utils.py
@@ -186,9 +186,9 @@ def sort_items(items, sort_str):
:param items: a list or generator object of items
:param sort_str: a string defining the sort rules, the format is
- '<key1>:[direction1],<key2>:[direction2]...', direction can be 'asc'
- for ascending or 'desc' for descending, if direction is not given,
- it's ascending by default
+ '<key1>:[direction1],<key2>:[direction2]...', direction can be 'asc'
+ for ascending or 'desc' for descending, if direction is not given,
+ it's ascending by default
:return: sorted items
"""
if not sort_str:
diff --git a/openstackclient/identity/v3/trust.py b/openstackclient/identity/v3/trust.py
index c8e5c4c7..5104864c 100644
--- a/openstackclient/identity/v3/trust.py
+++ b/openstackclient/identity/v3/trust.py
@@ -144,7 +144,7 @@ class CreateTrust(show.ShowOne):
# Format roles into something sensible
roles = trust._info.pop('roles')
- msg = ''.join([r['name'] + ' ' for r in roles])
+ msg = ' '.join(r['name'] for r in roles)
trust._info['roles'] = msg
return zip(*sorted(six.iteritems(trust._info)))
@@ -215,7 +215,7 @@ class ShowTrust(show.ShowOne):
# Format roles into something sensible
roles = trust._info.pop('roles')
- msg = ''.join([r['name'] + ' ' for r in roles])
+ msg = ' '.join(r['name'] for r in roles)
trust._info['roles'] = msg
return zip(*sorted(six.iteritems(trust._info)))
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 3dd98338..3808f6cf 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -219,7 +219,7 @@ class SaveImage(command.Command):
image_client.images,
parsed_args.image,
)
- data = image_client.images.data(image)
+ data = image_client.images.data(image.id)
gc_utils.save_image(data, parsed_args.file)
diff --git a/openstackclient/object/v1/lib/__init__.py b/openstackclient/object/v1/lib/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/openstackclient/object/v1/lib/__init__.py
+++ /dev/null
diff --git a/openstackclient/tests/identity/v3/test_trust.py b/openstackclient/tests/identity/v3/test_trust.py
index b3fbe7f0..b90e7815 100644
--- a/openstackclient/tests/identity/v3/test_trust.py
+++ b/openstackclient/tests/identity/v3/test_trust.py
@@ -107,7 +107,7 @@ class TestTrustCreate(TestTrust):
identity_fakes.trust_id,
identity_fakes.trust_impersonation,
identity_fakes.project_id,
- identity_fakes.role_name + ' ',
+ identity_fakes.role_name,
identity_fakes.user_id,
identity_fakes.user_id
)
@@ -222,7 +222,7 @@ class TestTrustShow(TestTrust):
identity_fakes.trust_id,
identity_fakes.trust_impersonation,
identity_fakes.project_id,
- identity_fakes.role_name + ' ',
+ identity_fakes.role_name,
identity_fakes.user_id,
identity_fakes.user_id
)
diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v1/snapshot.py
index 5ec2b3c5..e81efb5a 100644
--- a/openstackclient/volume/v1/snapshot.py
+++ b/openstackclient/volume/v1/snapshot.py
@@ -263,6 +263,7 @@ class UnsetSnapshot(command.Command):
default=[],
help='Property to remove from snapshot '
'(repeat to remove multiple values)',
+ required=True,
)
return parser
diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py
index ad9671e3..884611ec 100644
--- a/openstackclient/volume/v1/volume.py
+++ b/openstackclient/volume/v1/volume.py
@@ -437,6 +437,7 @@ class UnsetVolume(command.Command):
default=[],
help='Property to remove from volume '
'(repeat option to remove multiple properties)',
+ required=True,
)
return parser
diff --git a/openstackclient/volume/v1/type.py b/openstackclient/volume/v1/volume_type.py
index 46d1828b..d5c617b2 100644
--- a/openstackclient/volume/v1/type.py
+++ b/openstackclient/volume/v1/volume_type.py
@@ -166,6 +166,7 @@ class UnsetVolumeType(command.Command):
default=[],
help='Property to remove from volume type '
'(repeat option to remove multiple properties)',
+ required=True,
)
return parser
@@ -182,3 +183,27 @@ class UnsetVolumeType(command.Command):
else:
self.app.log.error("No changes requested\n")
return
+
+
+class ShowVolumeType(show.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(
+ "volume_type",
+ metavar="<volume-type>",
+ help="Volume type to display (name or ID)"
+ )
+ 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)
+ properties = utils.format_dict(volume_type._info.pop('extra_specs'))
+ volume_type._info.update({'properties': properties})
+ return zip(*sorted(six.iteritems(volume_type._info)))