Issue LIBCLOUD-363: Fix ElasticHosts bug. Now checks for HTTP 204 and HTTP 200 to determine drive imaging status.
Signed-off-by: Tomaz Muraus <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/73559d0b Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/73559d0b Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/73559d0b Branch: refs/heads/trunk Commit: 73559d0b741e8f86dcb8c0075eac714c32466185 Parents: 20fdc9c Author: Bob Thompson <[email protected]> Authored: Tue Jul 16 14:31:17 2013 -0400 Committer: Tomaz Muraus <[email protected]> Committed: Tue Aug 13 16:15:22 2013 +0200 ---------------------------------------------------------------------- libcloud/compute/drivers/elasticstack.py | 2 +- libcloud/test/compute/test_elasticstack.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/73559d0b/libcloud/compute/drivers/elasticstack.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/elasticstack.py b/libcloud/compute/drivers/elasticstack.py index b957614..603fdf7 100644 --- a/libcloud/compute/drivers/elasticstack.py +++ b/libcloud/compute/drivers/elasticstack.py @@ -276,7 +276,7 @@ class ElasticStackBaseNodeDriver(NodeDriver): method='POST' ) - if response.status != 204: + if response.status not in (200, 204): raise ElasticStackException('Drive imaging failed') # We wait until the drive is imaged and then boot up the node http://git-wip-us.apache.org/repos/asf/libcloud/blob/73559d0b/libcloud/test/compute/test_elasticstack.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_elasticstack.py b/libcloud/test/compute/test_elasticstack.py index 0b3faf8..5d30bbd 100644 --- a/libcloud/test/compute/test_elasticstack.py +++ b/libcloud/test/compute/test_elasticstack.py @@ -216,7 +216,7 @@ class ElasticStackMockHttp(MockHttp): def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_38df0986_4d85_4b76_b502_3878ffc80161_gunzip(self, method, url, body, headers): # ElasticHosts image - return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT]) + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_90aa51f2_15c0_4cff_81ee_e93aa20b9468_gunzip(self, method, url, body, headers): # Skalikloud image
