summaryrefslogtreecommitdiff
path: root/openstackclient/image/v2/image.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image/v2/image.py')
-rw-r--r--openstackclient/image/v2/image.py4
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