Swift CLI shows stack traces while segement_size is in a string

Bug #1244506 reported by Hugo Kou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Mahati Chamarthy

Bug Description

$> swift upload test -S 5G abc.img

Traceback (most recent call last):

File "/home/petersen/ve/local/lib/python2.7/site-packages/swiftclient/multithreading.py", line 69, in run

result = self.func(item, *self.args, **self.kwargs)

File "/home/petersen/ve/bin/swift", line 1026, in _object_job

getsize(path) > int(options.segment_size):

ValueError: invalid literal for int() with base 10: '5G'

Should it be a clear error msg for better user experience?

tags: added: low-hanging-fruit
Changed in swift:
assignee: nobody → Mahati (mahati-chamarthy)
Revision history for this message
Mahati Chamarthy (mahati-chamarthy) wrote :
Revision history for this message
Alistair Coles (alistair-coles) wrote :

I believe this is fixed by https://review.openstack.org/#/c/126310/ (merged)

Revision history for this message
Alistair Coles (alistair-coles) wrote :

commit 5f89dcc46ea0ae126c9ebc328d6569da839336cd
Author: Daniel Wakefield <email address hidden>
Date: Mon Oct 6 15:24:19 2014 +0100

    Allow segment size to be specified in a human readable way.

    Instead of always specifying segment size in bytes the user
    can now use B,K,M or G as suffixes for the corresponding
    size.

    Conversion is done with Binary units (1024) rather than SI
    units (1000).

    e.g

    swift upload test_container -S 1073741824 large_file
    can now be written
    swift upload test_container -S 1G large_file

    The change is backwards compatible as it ignores arguments to -S
    that don't have a valid suffix.

    Updated unit tests and help message.

    Change-Id: I6314b4e45cf2fbffde2fe57a02df77a25e911e84

Changed in swift:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 2.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.