libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [2/3] libcloud git commit: azure_arm: Convert more node states
Date Fri, 06 Oct 2017 19:11:47 GMT
azure_arm: Convert more node states

Closes #1003

Signed-off-by: Quentin Pradet <quentinp@apache.org>


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

Branch: refs/heads/trunk
Commit: 446300d88de9087fe8e3e6544d22140aa23ecc28
Parents: 3f29c35
Author: Markos Gogoulos <mgogoulos@mist.io>
Authored: Fri Oct 6 23:09:17 2017 +0400
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Fri Oct 6 23:09:17 2017 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/azure_arm.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/446300d8/libcloud/compute/drivers/azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index 225a9b5..bb6383c 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -1947,7 +1947,8 @@ class AzureNodeDriver(NodeDriver):
             r = self.connection.request(action,
                                         params={"api-version": "2015-06-15"})
             for status in r.object["statuses"]:
-                if status["code"] == "ProvisioningState/creating":
+                if status["code"] in ["ProvisioningState/creating",
+                                      "ProvisioningState/updating"]:
                     state = NodeState.PENDING
                     break
                 elif status["code"] == "ProvisioningState/deleting":
@@ -1965,6 +1966,9 @@ class AzureNodeDriver(NodeDriver):
                 if status["code"] == "PowerState/deallocated":
                     state = NodeState.STOPPED
                     break
+                elif status["code"] == "PowerState/stopped":
+                    state = NodeState.PAUSED
+                    break
                 elif status["code"] == "PowerState/deallocating":
                     state = NodeState.PENDING
                     break


Mime
View raw message