From d3a5ac96c526b58d6516fb1e4c40578d5513db2d Mon Sep 17 00:00:00 2001 From: Bob Thompson Date: Tue, 16 Jul 2013 14:31:17 -0400 Subject: [PATCH 3/3] Issue LIBCLOUD-363: Fix ElasticHosts bug. Now checks for HTTP 204 and HTTP 200 to determine drive imaging status. --- libcloud/compute/drivers/elasticstack.py | 2 +- libcloud/test/compute/test_elasticstack.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcloud/compute/drivers/elasticstack.py b/libcloud/compute/drivers/elasticstack.py index cec62c8..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 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 -- 1.8.1.msysgit.1