Fix the bug that created the node at ecs driver

1, From the official document can know parameter param['IoOptimized'] type is 
string and his value is ``none`` or ``optimized``


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

Branch: refs/heads/trunk
Commit: eafeccc4baa742001ffe19e400ed7879a6537661
Parents: 1a70a26
Author: hequn <[email protected]>
Authored: Thu Nov 10 15:06:37 2016 +0800
Committer: Anthony Shaw <[email protected]>
Committed: Tue Nov 15 10:20:52 2016 +1100

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


http://git-wip-us.apache.org/repos/asf/libcloud/blob/eafeccc4/libcloud/compute/drivers/ecs.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ecs.py b/libcloud/compute/drivers/ecs.py
index d55ed53..1dc6cb5 100644
--- a/libcloud/compute/drivers/ecs.py
+++ b/libcloud/compute/drivers/ecs.py
@@ -675,9 +675,9 @@ class ECSDriver(NodeDriver):
 
         if ex_io_optimized is not None:
             optimized = ex_io_optimized
-            if not isinstance(optimized, bool):
-                optimized = str(optimized).lower() == 'true'
-            params['IoOptimized'] = 'true' if optimized else 'false'
+            if isinstance(optimized, bool):
+                optimized = 'optimized' if optimized else 'none'
+            params['IoOptimized'] = optimized
 
         if ex_system_disk:
             system_disk = self._get_system_disk(ex_system_disk)

Reply via email to