Missed Exception handling in swift-ring-builder command.

Bug #1699985 reported by Saurabh jangir
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

When executing swift-ring-builder command if any of the parameters are sent with wrong type, improper error message "Value Error: Invalid literal for int() with base 10: s" is shown.

In CLI, exception handling is required for wrong argument passing.

Revision history for this message
Christian Schwede (cschwede) wrote :

Which version are you using?

Can you give us an example command that fails?

Changed in swift:
status: New → Incomplete
Revision history for this message
Saurabh jangir (sjopenstack) wrote :

swift version is : python-swiftclient 3.3.0

Issue is: when we provide wrong input type to below command. The exception is not handled appropriately.Please find the command output below.

[root@localhost swift]# swift-ring-builder account.builder create 10 3 a
Traceback (most recent call last):
  File "/usr/bin/swift-ring-builder", line 24, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/swift/cli/ringbuilder.py", line 1287, in main
    getattr(Commands, command, Commands.unknown)()
  File "/usr/lib/python2.7/site-packages/swift/cli/ringbuilder.py", line 446, in create
    builder = RingBuilder(int(argv[3]), float(argv[4]), int(argv[5]))
ValueError: invalid literal for int() with base 10: 'a'

Successful run is :-
[root@localhost swift]# swift-ring-builder account.builder create 10 3 1
[root@localhost swift]#

Changed in swift:
status: Incomplete → New
affects: swift → python-swiftclient
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.