From 56f66f2d04ecc8bec339f6ee8388814d56a66801 Mon Sep 17 00:00:00 2001 From: micafer Date: Thu, 11 Jul 2019 12:53:04 +0200 Subject: [PATCH] Fix #1309 --- libcloud/compute/drivers/openstack.py | 2 +- libcloud/test/compute/test_openstack.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py index 535630b283..efd742f50c 100644 --- a/libcloud/compute/drivers/openstack.py +++ b/libcloud/compute/drivers/openstack.py @@ -1588,7 +1588,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 diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py index 66b5dfd540..ed0412afee 100644 --- a/libcloud/test/compute/test_openstack.py +++ b/libcloud/test/compute/test_openstack.py @@ -601,7 +601,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 == '': + return (httplib.ACCEPTED, "", headers, httplib.responses[httplib.NO_CONTENT]) + else: + return httplib.BAD_REQUEST elif body.find('confirmResize') != -1: # test_ex_confirm_resize return (httplib.NO_CONTENT, "", headers, httplib.responses[httplib.NO_CONTENT])