python-libmaas
python-libmaas copied to clipboard
Delete character number restriction on error messages
In current version of python-lib maas dowlnoaded from github (commit ae3e321) Error messages can be no longer than 50 characters:
# amc/lib/python3.8/site-packages/maas/client/bones/__init__.py
class CallError(Exception):
def __init__(self, request, response, content, call):
desc_for_request = "%(method)s %(uri)s" % request
desc_for_response = "HTTP %s %s" % (response.status, response.reason)
desc_for_content = content.decode("utf-8", "replace")
desc = "%s -> %s (%s)" % (
desc_for_request,
desc_for_response,
desc_for_content
if len(desc_for_content) <= 50
else (desc_for_content)[:49] + "…"),
)
super(CallError, self).__init__(desc)
self.request = request
self.response = response
self.content = content
self.call = call
This lead to the situation where Error message actually tells nothing about error:
maas.client.bones.CallError: POST <http> -> HTTP 409 Conflict (Cannot set default gateway interface because the …)
I don't see a point of restricting such messages.
I am also routinely annoyed by this.
This issue is stale because it has been open for 30 days with no activity.