libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-925) Error in GCE driver in function _get_error
Date Sat, 24 Jun 2017 09:24:01 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061876#comment-16061876
] 

ASF subversion and git services commented on LIBCLOUD-925:
----------------------------------------------------------

Commit fe092f0c2ac45f140786deb89de9fa6942ed738a in libcloud's branch refs/heads/trunk from
[~micafer]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=fe092f0 ]

Fix #LIBCLOUD-925
Closes #1074


> Error in GCE driver in function _get_error
> ------------------------------------------
>
>                 Key: LIBCLOUD-925
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-925
>             Project: Libcloud
>          Issue Type: Bug
>            Reporter: Miguel Caballer
>            Priority: Minor
>              Labels: gce
>
> _get_error function assumes that the body['error'] value is a dict, but in some cases
it contains an string (unicode).
> So it tries to do a err.get and it failts.
> I has to be something like that:
> {noformat}
>         if 'code' in err:
>             code = err.get('code')
>             message = err.get('message')
>         else:
>             code = None
>             if 'reason' in err:
>                 code = err.get('reason')
>             message = body.get('error_description', err)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message