libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/2] libcloud git commit: added image details and size details to a node Closes #832
Date Thu, 14 Jul 2016 00:57:16 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 8ceabf734 -> 4b6d12b94


added image details and size details to a node
Closes #832


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

Branch: refs/heads/trunk
Commit: ae4f64e4f72d77050d163c7a3a30385d21c73056
Parents: 8ceabf7
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Mon Jul 4 15:29:24 2016 +1000
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Thu Jul 14 10:56:20 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py   | 4 ++++
 libcloud/test/compute/test_dimensiondata.py | 3 +++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ae4f64e4/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 075086b..4968ce6 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -2786,6 +2786,10 @@ class DimensionDataNodeDriver(NodeDriver):
                  state=node_state,
                  public_ips=[public_ip] if public_ip is not None else [],
                  private_ips=[private_ip] if private_ip is not None else [],
+                 size=self.list_sizes()[0],
+                 image=NodeImage(extra['sourceImageId'],
+                                 extra['OS_displayName'],
+                                 self.connection.driver),
                  driver=self.connection.driver,
                  extra=extra)
         return n

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ae4f64e4/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index bf1148d..5b5d755 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -126,6 +126,9 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         node = ret[3]
         self.assertTrue(isinstance(node.extra['disks'], list))
         self.assertTrue(isinstance(node.extra['disks'][0], DimensionDataServerDisk))
+        self.assertEqual(node.size.id, '1')
+        self.assertEqual(node.image.id, '3ebf3c0f-90fe-4a8b-8585-6e65b316592c')
+        self.assertEqual(node.image.name, 'WIN2008S/32')
         disk = node.extra['disks'][0]
         self.assertEqual(disk.id, "c2e1f199-116e-4dbc-9960-68720b832b0a")
         self.assertEqual(disk.scsi_id, 0)


Mime
View raw message