truncated error messages

Bug #1408001 reported by Pavlo Shchelokovskyy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

When trying to delete a non-empty swift container the exception raised by swiftclient is completely incomprehensible as it has HTML elements in the message and the message is heavily truncated:

ClientException: Container DELETE failed: http://192.168.100.127:8080/v1/AUTH_93bc980d9ea442f8a04583db58ae6c98/sw-container-h6circycoksh 409 Conflict [first 60 chars of response] <html><h1>Conflict</h1><p>There was a conflict when trying t

To circumvent it one has to jump through some extra hoops as in fixes related to this bug report:
https://bugs.launchpad.net/heat/+bug/1406263

Similar bug is already raised in respect to another swiftclient command :
https://bugs.launchpad.net/python-swiftclient/+bug/1258391

It seems that errors raised by swiftclient should be better structured and/or contain more useful messages to assert them via the Python API.

Revision history for this message
Charles Hsu (charles0126) wrote :

Which version of swift client that you used?
The swiftclient allows user to delete whole container(non-empty) In current version (2.3.1).

Revision history for this message
Pavlo Shchelokovskyy (pshchelo) wrote :

That's because the shell is using the SwiftService object [1], that indeed does recursive delete by itself [2]. In Heat we use Connection object as client to perform all the operations [3], and this one is not supporting recursive deletes.

[1] https://github.com/openstack/python-swiftclient/blob/master/swiftclient/shell.py#L100
[2] https://github.com/openstack/python-swiftclient/blob/master/swiftclient/service.py#L1820
[3] https://github.com/openstack/heat/blob/master/heat/engine/clients/os/swift.py#L53

regardless of this, the exceptions raised by the Python API are still pretty useless in explaining the reason of the failure.

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.