libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject libcloud git commit: Add missing upcloud driver to providers
Date Tue, 03 Oct 2017 16:59:16 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 54bf2d9ff -> 23e65bef0


Add missing upcloud driver to providers

Closes #1119

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/23e65bef
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/23e65bef
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/23e65bef

Branch: refs/heads/trunk
Commit: 23e65bef08e1ade2556afa5e970237ffc13e973f
Parents: 54bf2d9
Author: Mika Lackman <mika.lackman@upcloud.com>
Authored: Tue Oct 3 15:16:58 2017 +0300
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Tue Oct 3 20:52:56 2017 +0400

----------------------------------------------------------------------
 libcloud/compute/providers.py         | 2 ++
 libcloud/test/compute/test_upcloud.py | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/23e65bef/libcloud/compute/providers.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/providers.py b/libcloud/compute/providers.py
index a1c4868..72a5a85 100644
--- a/libcloud/compute/providers.py
+++ b/libcloud/compute/providers.py
@@ -145,6 +145,8 @@ DRIVERS = {
     ('libcloud.compute.drivers.cloudscale', 'CloudscaleNodeDriver'),
     Provider.ONEANDONE:
     ('libcloud.compute.drivers.oneandone', 'OneAndOneNodeDriver'),
+    Provider.UPCLOUD:
+    ('libcloud.compute.drivers.upcloud', 'UpcloudDriver'),
 }
 
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/23e65bef/libcloud/test/compute/test_upcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_upcloud.py b/libcloud/test/compute/test_upcloud.py
index 98e0105..fe42388 100644
--- a/libcloud/test/compute/test_upcloud.py
+++ b/libcloud/test/compute/test_upcloud.py
@@ -23,8 +23,9 @@ from libcloud.utils.py3 import httplib, ensure_string
 from libcloud.compute.drivers.upcloud import UpcloudDriver
 from libcloud.common.types import InvalidCredsError
 from libcloud.compute.drivers.upcloud import UpcloudResponse
-from libcloud.compute.types import NodeState
+from libcloud.compute.types import NodeState, Provider
 from libcloud.compute.base import NodeImage, NodeSize, NodeLocation, NodeAuthSSHKey, Node
+from libcloud.compute import providers
 from libcloud.test import LibcloudTestCase, unittest, MockHttp
 from libcloud.test.file_fixtures import ComputeFileFixtures
 from libcloud.test.secrets import UPCLOUD_PARAMS
@@ -61,6 +62,10 @@ class UpcloudDriverTests(LibcloudTestCase):
         # UpcloudDriver.connectionCls.responseCls = UpcloudPersistResponse
         self.driver = UpcloudDriver(*UPCLOUD_PARAMS)
 
+    def test_creating_driver(self):
+        cls = providers.get_driver(Provider.UPCLOUD)
+        self.assertIs(cls, UpcloudDriver)
+
     def test_features(self):
         features = self.driver.features['create_node']
         self.assertIn('ssh_key', features)
@@ -238,5 +243,6 @@ class UpcloudMockHttp(MockHttp):
         body = self.fixtures.load('api_1_2_server_00893c98-5d5a-4363-b177-88df518a2b60.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+
 if __name__ == '__main__':
     sys.exit(unittest.main())


Mime
View raw message