libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/2] libcloud git commit: Add instance fault to OpenStack_NodeDriver
Date Sat, 01 Aug 2015 09:30:05 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 79680b56e -> ef22c3480


Add instance fault to OpenStack_NodeDriver

`InstanceFault` is returned by the API but is not saved in the `OpenStack_1_1_NodeDriver.extra`
field. Adding `fault` to the `extra` field.
(https://issues.apache.org/jira/browse/LIBCLOUD-730)

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


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

Branch: refs/heads/trunk
Commit: 97e5e8403c85db0374ce2cb2935382d09f9b1301
Parents: 79680b5
Author: Nick Fox <nick.fox@rackspace.com>
Authored: Fri Jul 31 15:17:13 2015 -0500
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sat Aug 1 11:28:23 2015 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/openstack.py                        | 1 +
 .../compute/fixtures/openstack_v1.1/_servers_detail.json     | 8 ++++++++
 libcloud/test/compute/test_openstack.py                      | 1 +
 3 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/97e5e840/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 211e8fb..469f5d6 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -2113,6 +2113,7 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
                 vm_state=api_node.get("OS-EXT-STS:vm_state", None),
                 power_state=api_node.get("OS-EXT-STS:power_state", None),
                 progress=api_node.get("progress", None),
+                fault=api_node.get('fault')
             ),
         )
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/97e5e840/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json b/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json
index 1bc875d..4c31b27 100644
--- a/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json
+++ b/libcloud/test/compute/fixtures/openstack_v1.1/_servers_detail.json
@@ -85,6 +85,14 @@
                     }
                 ]
             },
+            "fault": {
+                "id": 1234,
+                "instance_uuid": "ec53630b-e4fb-442a-a748-c376f5c4345b",
+                "code": "500",
+                "message": "test message",
+                "details": "No valid host was found.",
+                "host": "912566d83a13fbb357ea3f13c629363d9f7e1ba3f925b49f3d2ab725"
+            },
             "config_drive": "",
             "id": 12065,
             "metadata": {},

http://git-wip-us.apache.org/repos/asf/libcloud/blob/97e5e840/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index feb5a0c..677b1be 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -788,6 +788,7 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
         self.assertEqual(node.extra.get('vm_state'), 'active')
         self.assertEqual(node.extra.get('power_state'), 1)
         self.assertEqual(node.extra.get('progress'), 25)
+        self.assertEqual(node.extra.get('fault')['id'], 1234)
 
     def test_list_nodes_no_image_id_attribute(self):
         # Regression test for LIBCLOD-455


Mime
View raw message