You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2020/04/03 21:50:01 UTC

[libcloud] branch trunk updated (3f65ba6 -> c963f08)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from 3f65ba6  Add new stdout and stderr attribute to SSHCommandTimeoutError class.
     add 25473a8  Fix auto assigning of volume device in OpenStack
     new 197a628  Merge branch 'patch-1' of https://github.com/jhesketh/libcloud into jhesketh-patch-1
     new 1b2c399  Add a test case for it.
     new c86fe68  Add changelog entry.
     new c963f08  Don't run additional assertions when running rackspace tests.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.rst                             |  5 +++++
 libcloud/compute/drivers/openstack.py   |  2 ++
 libcloud/test/compute/test_openstack.py | 27 ++++++++++++++++++++++++++-
 3 files changed, 33 insertions(+), 1 deletion(-)


[libcloud] 03/04: Add changelog entry.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit c86fe68f75c872812d04bd91abbc0b3dcb18eb4a
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Apr 3 23:44:42 2020 +0200

    Add changelog entry.
---
 CHANGES.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/CHANGES.rst b/CHANGES.rst
index 79af909..efe7870 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -104,6 +104,11 @@ Compute
   (GITHUB-1445)
   [Tomaz Muraus - @Kami]
 
+- [OpenStack] Fix auto assignment of volume device when using device name
+  ``auto`` in the ``attach_volume`` method.
+  (GITHUB-1444)
+  [Joshua Hesketh - @jhesketh]
+
 Storage
 ~~~~~~~
 


[libcloud] 02/04: Add a test case for it.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 1b2c399b06193145e0062667867e0b39ee754e9c
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Apr 3 23:42:53 2020 +0200

    Add a test case for it.
---
 libcloud/test/compute/test_openstack.py | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index 0fd510a..a7dd0ec 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -1048,6 +1048,17 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
         self.assertEqual(
             self.driver.attach_volume(node, volume, '/dev/sdb'), True)
 
+    def test_attach_volume_device_auto(self):
+        node = self.driver.list_nodes()[0]
+        volume = self.driver.ex_get_volume(
+            'cd76a3a1-c4ce-40f6-9b9f-07a61508938d')
+
+        OpenStack_1_1_MockHttp.type = 'DEVICE_AUTO'
+        OpenStack_2_0_MockHttp.type = 'DEVICE_AUTO'
+
+        self.assertEqual(
+            self.driver.attach_volume(node, volume, 'auto'), True)
+
     def test_detach_volume(self):
         node = self.driver.list_nodes()[0]
         volume = self.driver.ex_get_volume(
@@ -2331,6 +2342,15 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
         else:
             raise NotImplementedError()
 
+    def _v2_1337_servers_12065_os_volume_attachments_DEVICE_AUTO(self, method, url, body, headers):
+        # test_attach_volume_device_auto
+        if method == "POST":
+            body = json.loads(body)
+            self.assertEqual(body['volumeAttachment']['device'], None)
+            return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT])
+        else:
+            raise NotImplementedError()
+
     def _v2_1337_servers_1c01300f_ef97_4937_8f03_ac676d6234be_os_interface_126da55e_cfcb_41c8_ae39_a26cb8a7e723(self, method, url, body, headers):
         if method == "DELETE":
             return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT])
@@ -2441,6 +2461,8 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
 
     def _v1_1_slug_servers_12065_os_volume_attachments(self, method, url, body, headers):
         if method == "POST":
+            body = json.loads(body)
+            self.assertEqual(body['volumeAttachment']['device'], '/dev/sdb')
             body = self.fixtures.load(
                 '_servers_12065_os_volume_attachments.json')
         else:
@@ -2687,7 +2709,7 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
         if method == 'GET':
             body = self.fixtures.load('_v2_0__floatingips.json')
             return (httplib.OK, body, self.json_content_headers, httplib.responses[httplib.OK])
-    
+
     def _v2_1337_v2_0_floatingips_foo_bar_id(self, method, url, body, headers):
         if method == 'DELETE':
             body = ''


[libcloud] 01/04: Merge branch 'patch-1' of https://github.com/jhesketh/libcloud into jhesketh-patch-1

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 197a6280afd2243c2d61c55ed59392bbb70eb780
Merge: 3f65ba6 25473a8
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Apr 3 22:45:10 2020 +0200

    Merge branch 'patch-1' of https://github.com/jhesketh/libcloud into jhesketh-patch-1

 libcloud/compute/drivers/openstack.py | 2 ++
 1 file changed, 2 insertions(+)


[libcloud] 04/04: Don't run additional assertions when running rackspace tests.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit c963f0881294db1fd4e981094730e0c63677c4d8
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Fri Apr 3 23:48:48 2020 +0200

    Don't run additional assertions when running rackspace tests.
---
 libcloud/test/compute/test_openstack.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index a7dd0ec..fb48e56 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -1053,7 +1053,6 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
         volume = self.driver.ex_get_volume(
             'cd76a3a1-c4ce-40f6-9b9f-07a61508938d')
 
-        OpenStack_1_1_MockHttp.type = 'DEVICE_AUTO'
         OpenStack_2_0_MockHttp.type = 'DEVICE_AUTO'
 
         self.assertEqual(
@@ -2345,8 +2344,10 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
     def _v2_1337_servers_12065_os_volume_attachments_DEVICE_AUTO(self, method, url, body, headers):
         # test_attach_volume_device_auto
         if method == "POST":
-            body = json.loads(body)
-            self.assertEqual(body['volumeAttachment']['device'], None)
+            if 'rackspace' not in self.__class__.__name__.lower():
+                body = json.loads(body)
+                self.assertEqual(body['volumeAttachment']['device'], None)
+
             return (httplib.NO_CONTENT, "", {}, httplib.responses[httplib.NO_CONTENT])
         else:
             raise NotImplementedError()
@@ -2461,8 +2462,10 @@ class OpenStack_1_1_MockHttp(MockHttp, unittest.TestCase):
 
     def _v1_1_slug_servers_12065_os_volume_attachments(self, method, url, body, headers):
         if method == "POST":
-            body = json.loads(body)
-            self.assertEqual(body['volumeAttachment']['device'], '/dev/sdb')
+            if 'rackspace' not in self.__class__.__name__.lower():
+                body = json.loads(body)
+                self.assertEqual(body['volumeAttachment']['device'], '/dev/sdb')
+
             body = self.fixtures.load(
                 '_servers_12065_os_volume_attachments.json')
         else: