swift-ring-builder blows up when method not found

Bug #1154882 reported by Tong Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
Tong Li

Bug Description

When an invalid method is given, swift-ring-builder will blow up with stack trace.

# swift-ring-builder object.builder balance
Traceback (most recent call last):
  File "/usr/local/bin/swift-ring-builder", line 5, in <module>
    pkg_resources.run_script('swift==1.7.7', 'swift-ring-builder')
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 489, in run_script
    yield ep
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1207, in run_script
    def get_metadata(self, name):
  File "/usr/local/lib/python2.7/dist-packages/swift-1.7.7-py2.7.egg/EGG-INFO/scripts/swift-ring-builder", line 673, in <module>
    Commands.__dict__.get(command, Commands.unknown)()
TypeError: unbound method unknown() must be called with Commands instance as first argument (got nothing instead)

Wanted to give rebalance, instead give balance,
swift-ring-builder will show stack trace. it will be nice to catch this error and show a nice error message.

Changed in swift:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24549

Changed in swift:
assignee: nobody → Tong Li (litong01)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/24549
Committed: http://github.com/openstack/swift/commit/b530de2ad55c7ff6982237a9c29219d5cae44742
Submitter: Jenkins
Branch: master

commit b530de2ad55c7ff6982237a9c29219d5cae44742
Author: tong li <email address hidden>
Date: Mon Mar 18 09:04:13 2013 -0400

    swift-ring-builder blows up when not supported command requested.

    swift-ring-builder uses outdated unbounded class method to handle
    not supported command. It worked for python 2.6 or older but not
    for python 2.7 or newer. This patch fixes the problem.

    Change-Id: I7dbc681ef6be44f6d79ff93189ccca13c51eab74
    Fixes: bug #1154882

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.8.0-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in swift:
milestone: 1.8.0-rc1 → 1.8.0
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.