Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1186176

Summary: Glance image-download .. --progress fails: object of type 'generator' has no len()
Product: Red Hat OpenStack Reporter: Tzach Shefi <tshefi>
Component: python-glanceclientAssignee: CIndy Pallares <cpallare>
Status: CLOSED UPSTREAM QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0 (Juno)CC: eglynn, fpercoco, jruzicka, sgotliv, yeylon
Target Milestone: ---   
Target Release: 7.0 (Kilo)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1383228 (view as bug list) Environment:
Last Closed: 2015-01-27 15:12:13 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1383228    
Attachments:
Description Flags
Glance logs none

Description Tzach Shefi 2015-01-27 09:25:06 UTC
Created attachment 984566 [details]
Glance logs

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()

Comment 1 Flavio Percoco 2015-01-27 15:12:13 UTC
This seems to have been fixed upstream. No need to track it here.