libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [1/2] libcloud git commit: fix unexpected body type openstack image sharing
Date Wed, 21 Mar 2018 17:11:39 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk f07c6dd45 -> a297b3cc8


fix unexpected body type openstack image sharing

Looks like I introduced a bug here [in this PR](https://github.com/apache/libcloud/pull/1176)

before:
```
In [3]: conn.ex_create_image_member('a4f9cd7a-188a-444c-90a6-d24b8c688a63', '1d14ce09c41e4b53a3be31ff980d47e3')
...
[u'Unexpected body type. Expected list/dict.<br /><br />\n\n\n', u'400 Bad Request',
u'Bad Request']
```

after:
```
In [3]: conn.ex_create_image_member('a4f9cd7a-188a-444c-90a6-d24b8c688a63', '1d14ce09c41e4b53a3be31ff980d47e3')
Out[3]: <NodeImageMember: id=1d14ce09c41e4b53a3be31ff980d47e3, image_id=a4f9cd7a-188a-444c-90a6-d24b8c688a63,
state=pending, driver=OpenStack  ...>
```

Signed-off-by: Quentin Pradet <quentinp@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2d0f446c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2d0f446c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2d0f446c

Branch: refs/heads/trunk
Commit: 2d0f446c05147d998a361a92e90ebb1c58d53377
Parents: f07c6dd
Author: Rick van de Loo <rickvandeloo@gmail.com>
Authored: Mon Mar 19 14:09:52 2018 +0100
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Wed Mar 21 21:08:36 2018 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/openstack.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/2d0f446c/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 91eb1a4..ea38fad 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -2599,7 +2599,7 @@ class OpenStack_2_NodeDriver(OpenStack_1_1_NodeDriver):
             headers={'Content-type': 'application/'
                                      'openstack-images-'
                                      'v2.1-json-patch'},
-            method='PATCH', data=json.dumps(data)
+            method='PATCH', data=data
         )
         return self._to_image(response.object)
 
@@ -2652,7 +2652,7 @@ class OpenStack_2_NodeDriver(OpenStack_1_1_NodeDriver):
         data = {'member': member_id}
         response = self.image_connection.request(
             '/v2/images/%s/members' % image_id,
-            method='POST', data=json.dumps(data)
+            method='POST', data=data
         )
         return self._to_image_member(response.object)
 
@@ -2692,7 +2692,7 @@ class OpenStack_2_NodeDriver(OpenStack_1_1_NodeDriver):
         data = {'status': 'accepted'}
         response = self.image_connection.request(
             '/v2/images/%s/members/%s' % (image_id, member_id),
-            method='PUT', data=json.dumps(data)
+            method='PUT', data=data
         )
         return self._to_image_member(response.object)
 


Mime
View raw message