Skip to content

Commit

Permalink
Merge pull request #1311 from micafer/ost_resize
Browse files Browse the repository at this point in the history
Fix error in resize function in OpenStack driver #1309
  • Loading branch information
Kami authored Jul 12, 2019
2 parents 76391db + c2fe4db commit 51687ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libcloud/compute/drivers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ def ex_resize(self, node, size):
:rtype: ``bool``
"""
server_params = self._create_args_to_params(node, size=size)
server_params = {'flavorRef': size.id}
resp = self._node_action(node, 'resize', **server_params)
return resp.status == httplib.ACCEPTED

Expand Down
5 changes: 4 additions & 1 deletion libcloud/test/compute/test_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,10 @@ def _v1_0_slug_servers_444222_action(self, method, url, body, headers):
body = u(body)
if body.find('resize') != -1:
# test_ex_resize_server
return (httplib.ACCEPTED, "", headers, httplib.responses[httplib.NO_CONTENT])
if body.find('personality') != -1:
return httplib.BAD_REQUEST
else:
return (httplib.ACCEPTED, "", headers, httplib.responses[httplib.NO_CONTENT])
elif body.find('confirmResize') != -1:
# test_ex_confirm_resize
return (httplib.NO_CONTENT, "", headers, httplib.responses[httplib.NO_CONTENT])
Expand Down

0 comments on commit 51687ee

Please sign in to comment.