summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image')
-rw-r--r--openstackclient/image/v1/image.py9
-rw-r--r--openstackclient/image/v2/image.py14
2 files changed, 16 insertions, 7 deletions
diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py
index 35e9ef43..4ebc8f93 100644
--- a/openstackclient/image/v1/image.py
+++ b/openstackclient/image/v1/image.py
@@ -354,7 +354,12 @@ class ListImage(lister.Lister):
kwargs['public'] = True
if parsed_args.private:
kwargs['private'] = True
- kwargs['detailed'] = bool(parsed_args.property or parsed_args.long)
+ # Note: We specifically need to do that below to get the 'status'
+ # column.
+ #
+ # Always set kwargs['detailed'] to True, and then filter the columns
+ # according to whether the --long option is specified or not.
+ kwargs['detailed'] = True
if parsed_args.long:
columns = (
@@ -382,7 +387,7 @@ class ListImage(lister.Lister):
'Properties',
)
else:
- columns = ("ID", "Name")
+ columns = ("ID", "Name", "Status")
column_headers = columns
# List of image data received
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py
index 2b3f3bfd..a3c1a99d 100644
--- a/openstackclient/image/v2/image.py
+++ b/openstackclient/image/v2/image.py
@@ -105,21 +105,20 @@ class AddProjectToImage(show.ShowOne):
project_id,
)
- return zip(*sorted(six.iteritems(image_member._info)))
+ return zip(*sorted(six.iteritems(image_member)))
class CreateImage(show.ShowOne):
"""Create/upload an image"""
log = logging.getLogger(__name__ + ".CreateImage")
- deadopts = ('owner', 'size', 'location', 'copy-from', 'checksum', 'store')
+ deadopts = ('size', 'location', 'copy-from', 'checksum', 'store')
def get_parser(self, prog_name):
parser = super(CreateImage, self).get_parser(prog_name)
# TODO(bunting): There are additional arguments that v1 supported
# that v2 either doesn't support or supports weirdly.
# --checksum - could be faked clientside perhaps?
- # --owner - could be set as an update after the put?
# --location - maybe location add?
# --size - passing image size is actually broken in python-glanceclient
# --copy-from - does not exist in v2
@@ -149,6 +148,11 @@ class CreateImage(show.ShowOne):
"(default: %s)" % DEFAULT_DISK_FORMAT,
)
parser.add_argument(
+ "--owner",
+ metavar="<owner>",
+ help="Image owner project name or ID",
+ )
+ parser.add_argument(
"--min-disk",
metavar="<disk-gb>",
type=int,
@@ -241,7 +245,7 @@ class CreateImage(show.ShowOne):
copy_attrs = ('name', 'id',
'container_format', 'disk_format',
'min_disk', 'min_ram',
- 'tags')
+ 'tags', 'owner')
for attr in copy_attrs:
if attr in parsed_args:
val = getattr(parsed_args, attr, None)
@@ -449,7 +453,7 @@ class ListImage(lister.Lister):
'Tags',
)
else:
- columns = ("ID", "Name")
+ columns = ("ID", "Name", "Status")
column_headers = columns
# List of image data received