libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Planchenault (JIRA)" <>
Subject [jira] [Created] (LIBCLOUD-989) Small bug in common/
Date Mon, 19 Mar 2018 14:03:00 GMT
Vincent Planchenault created LIBCLOUD-989:

             Summary: Small bug in common/
                 Key: LIBCLOUD-989
             Project: Libcloud
          Issue Type: Bug
          Components: Core
         Environment: Python 2.7

libcloud 2.3.0
            Reporter: Vincent Planchenault


I encountered a small bug in common/, when an Openstack compatible french Cloud
Provider wanted to tell me I've used its API at a too high rate.

In this case, the API returned a status 503, with a message composed of fields 'message' and
'request', without 'code' field

The code in line 393 in common/ raises in this case a TypeError exception, because
there is no 'code' field in the values.

I changed this line from:

    if len(values) > 0 and values[0]['code'] == 404 and key_pair_name:


    if len(values) > 0 and 'code' in values[0] and values[0]['code'] == 404 and key_pair_name:

Now, it raises a libcloud.exception_from_message I  can handle properly.


This message was sent by Atlassian JIRA

View raw message