diff options
| author | Zuul <zuul@review.opendev.org> | 2022-11-16 12:27:47 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-11-16 12:27:47 +0000 |
| commit | a2706f5a80a16ace7506a9886ecda4a236d738da (patch) | |
| tree | 0b4f4379329c71c0663101d7a2ede88c81071d32 /openstackclient/image/v2 | |
| parent | e708ddc2a3bbd764a870909c162109314a6f4ae1 (diff) | |
| parent | bafece762a5d0b03e28f9d81c98ad46777f56a34 (diff) | |
| download | python-openstackclient-a2706f5a80a16ace7506a9886ecda4a236d738da.tar.gz | |
Merge "image: Ignore '--progress' if providing image data from stdin"
Diffstat (limited to 'openstackclient/image/v2')
| -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 |
