Bug 1383228

Summary: [OSP6] [Backport] Glance image-download .. --progress fails: object of type 'generator' has no len()
Product: Red Hat OpenStack Reporter: Ondrej <ochalups>
Component: python-glanceclientAssignee: Cyril Roelandt <cyril>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0 (Juno)CC: cpallare, dcadzow, eglynn, fpercoco, jruzicka, jschluet, nlevinki, pablo.iranzo, sgotliv, srevivo, tshefi, yeylon
Target Milestone: ---Keywords: FeatureBackport, ZStream
Target Release: 6.0 (Juno)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python-glanceclient-0.14.2-6.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1186176 Environment:
Last Closed: 2017-02-15 13:50:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1186176    
Bug Blocks:    

Description Ondrej 2016-10-10 08:56:59 UTC
+++ This bug was initially created as a clone of Bug #1186176 +++
Hi,
the bug was fixed in OSP-7, is it possible to backport the fix to OSP-6?

Package versions:

python-glance-2014.2.3-4.el7ost.noarch
python-glanceclient-0.14.2-5.el7ost.noarch
python-glance-store-0.1.10-6.el7ost.noarch
openstack-glance-2014.2.3-4.el7ost.noarch

Thanks,
Ondrej

Description of problem: When downloading a glance image while adding --progress  I get an error:
object of type 'generator' has no len() 

Same command without --progress works fine.  

Version-Release number of selected component (if applicable):
rhel7
python-glance-2014.2.1-2.el7ost.noarch
python-glanceclient-0.14.2-1.el7ost.noarch
python-glance-store-0.1.8-1.el7ost.noarch
openstack-glance-2014.2.1-2.el7ost.noarch

On Icehouse ( python-glanceclient-0.13.1-1.el7ost.noarch 
) it works fine, just checked it now.  

How reproducible:
Every time, on two separate deployments 

Steps to Reproduce:
1. Upload image to glance
2. glance image-download <imageID> --file test.raw --progress - fails 
3. Do same without --progress works fine.

4. Also tested with a snapshot of an instance as source same error.  

Actual results:
# glance image-download c3d3f.... --file cirros2.raw --progress
object of type 'generator' has no len()  

Expected results:
File should download without error and with progress bar indicator

Additional info:
--debug info: 

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 602, in main
    args.func(client, args)                                                       
  File "/usr/lib/python2.7/site-packages/glanceclient/v1/shell.py", line 151, in do_image_download
    body = progressbar.VerboseIteratorWrapper(body, len(body))                                    
TypeError: object of type 'generator' has no len()                                                
object of type 'generator' has no len()

--- Additional comment from Flavio Percoco on 2015-01-27 10:12:13 EST ---

This seems to have been fixed upstream. No need to track it here.

Comment 5 errata-xmlrpc 2017-02-15 13:50:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0278.html