diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2022-10-21 16:40:36 +0100 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2022-11-09 16:51:54 +0000 |
| commit | bafece762a5d0b03e28f9d81c98ad46777f56a34 (patch) | |
| tree | 88f0dc354190802b7875e8e4d969e56f080489f6 /openstackclient/image | |
| parent | 31881c0b2b6581e16a1d802b01a52d2b2eefb750 (diff) | |
| download | python-openstackclient-bafece762a5d0b03e28f9d81c98ad46777f56a34.tar.gz | |
image: Ignore '--progress' if providing image data from stdin
You can provide data via stdin when creating an image. Using this with
'--progress' makes no sense and causes an error currently. Fix this.
Change-Id: I3c2d658b72a7c62931b779b0d19bb97f60a0c655
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/image')
| -rw-r--r-- | openstackclient/image/v2/image.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 2342fd3e..1ff8ad3a 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -476,7 +476,9 @@ class CreateImage(command.ShowOne): LOG.warning(_("Failed to get an image file.")) return {}, {} - if fp is not None and parsed_args.progress: + if parsed_args.progress and parsed_args.file: + # NOTE(stephenfin): we only show a progress bar if the user + # requested it *and* we're reading from a file (not stdin) filesize = os.path.getsize(fname) if filesize is not None: kwargs['validate_checksum'] = False |
