libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [4/7] libcloud git commit: Use standard triple double-quoted docstring
Date Fri, 16 Mar 2018 15:26:06 GMT
Use standard triple double-quoted docstring

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

Branch: refs/heads/trunk
Commit: 2c2cbd9c0be15388bcab27ef08f19a17a7ec517f
Parents: 56ce2bf
Author: Rémy Léone <rleone@online.net>
Authored: Fri Mar 16 10:49:31 2018 +0100
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Fri Mar 16 19:21:55 2018 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/cloudscale.py     | 32 ++++++++++++-------------
 libcloud/compute/drivers/ktucloud.py       |  2 +-
 libcloud/compute/drivers/profitbricks.py   |  8 +++----
 libcloud/compute/drivers/vcloud.py         |  4 ++--
 libcloud/loadbalancer/drivers/ninefold.py  |  2 +-
 libcloud/test/common/test_upcloud.py       |  4 ++--
 libcloud/test/compute/test_profitbricks.py | 12 +++++-----
 7 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/compute/drivers/cloudscale.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudscale.py b/libcloud/compute/drivers/cloudscale.py
index 1023b22..43155ff 100644
--- a/libcloud/compute/drivers/cloudscale.py
+++ b/libcloud/compute/drivers/cloudscale.py
@@ -86,25 +86,25 @@ class CloudscaleNodeDriver(NodeDriver):
         super(CloudscaleNodeDriver, self).__init__(key, **kwargs)
 
     def list_nodes(self):
-        '''
+        """
         List all your existing compute nodes.
-        '''
+        """
         return self._list_resources('/v1/servers', self._to_node)
 
     def list_sizes(self):
-        '''
+        """
         Lists all available sizes. On cloudscale these are known as flavors.
-        '''
+        """
         return self._list_resources('/v1/flavors', self._to_size)
 
     def list_images(self):
-        '''
+        """
         List all images.
 
         Images are identified by slugs on cloudscale.ch. This means that minor
         version upgrades (e.g. Ubuntu 16.04.1 to Ubuntu 16.04.2) will be
         possible within the same id ``ubuntu-16.04``.
-        '''
+        """
         return self._list_resources('/v1/images', self._to_image)
 
     def create_node(self, name, size, image, location=None, ex_create_attr={}):
@@ -145,42 +145,42 @@ class CloudscaleNodeDriver(NodeDriver):
         return self._to_node(result.object)
 
     def reboot_node(self, node):
-        '''
+        """
         Reboot a node. It's also possible to use ``node.reboot()``.
-        '''
+        """
         return self._action(node, 'reboot')
 
     def ex_start_node(self, node):
-        '''
+        """
         Start a node. This is only possible if the node is stopped.
-        '''
+        """
         return self._action(node, 'start')
 
     def ex_stop_node(self, node):
-        '''
+        """
         Stop a specific node. Similar to ``shutdown -h now``. This is only
         possible if the node is running.
-        '''
+        """
         return self._action(node, 'stop')
 
     def ex_node_by_uuid(self, uuid):
-        '''
+        """
         :param str ex_user_data: A valid uuid that references your exisiting
             cloudscale.ch server.
         :type       ex_user_data:  ``str``
 
         :return: The server node you asked for.
         :rtype: :class:`Node`
-        '''
+        """
         res = self.connection.request(self._get_server_url(uuid))
         return self._to_node(res.object)
 
     def destroy_node(self, node):
-        '''
+        """
         Delete a node. It's also possible to use ``node.destroy()``.
         This will irreversibly delete the cloudscale.ch server and all its
         volumes. So please be cautious.
-        '''
+        """
         res = self.connection.request(
             self._get_server_url(node.id),
             method='DELETE'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/compute/drivers/ktucloud.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ktucloud.py b/libcloud/compute/drivers/ktucloud.py
index 1bc8544..75a5eef 100644
--- a/libcloud/compute/drivers/ktucloud.py
+++ b/libcloud/compute/drivers/ktucloud.py
@@ -19,7 +19,7 @@ from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver
 
 
 class KTUCloudNodeDriver(CloudStackNodeDriver):
-    "Driver for KTUCloud Compute platform."
+    """Driver for KTUCloud Compute platform."""
 
     EMPTY_DISKOFFERINGID = '0'
     type = Provider.KTUCLOUD

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/compute/drivers/profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py
index d117c9a..cd22354 100644
--- a/libcloud/compute/drivers/profitbricks.py
+++ b/libcloud/compute/drivers/profitbricks.py
@@ -104,11 +104,11 @@ class ProfitBricksConnection(ConnectionUserAndKey):
         return headers
 
     def encode_data(self, data):
-        '''
+        """
         If a string is passed in, just return it
         or else if a dict is passed in, encode it
         as a json string.
-        '''
+        """
         if type(data) is str:
             return data
 
@@ -121,13 +121,13 @@ class ProfitBricksConnection(ConnectionUserAndKey):
     def request(self, action, params=None, data=None, headers=None,
                 method='GET', raw=False, with_full_url=False):
 
-        '''
+        """
         Some requests will use the href attribute directly.
         If this is not the case, then we should formulate the
         url based on the action specified.
         If we are using a full url, we need to remove the
         host and protocol components.
-        '''
+        """
         if not with_full_url or with_full_url is False:
             action = self.api_prefix + action.lstrip('/')
         else:

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/compute/drivers/vcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py
index d2b833d..7c0af31 100644
--- a/libcloud/compute/drivers/vcloud.py
+++ b/libcloud/compute/drivers/vcloud.py
@@ -2226,9 +2226,9 @@ class VCloud_5_1_NodeDriver(VCloud_1_5_NodeDriver):
 
 
 class VCloud_5_5_NodeDriver(VCloud_5_1_NodeDriver):
-    '''Use 5.5 Connection class to explicitly set 5.5 for the version in
+    """Use 5.5 Connection class to explicitly set 5.5 for the version in
     Accept headers
-    '''
+    """
     connectionCls = VCloud_5_5_Connection
 
     def ex_create_snapshot(self, node):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/loadbalancer/drivers/ninefold.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/ninefold.py b/libcloud/loadbalancer/drivers/ninefold.py
index cb28f6c..1365cdf 100644
--- a/libcloud/loadbalancer/drivers/ninefold.py
+++ b/libcloud/loadbalancer/drivers/ninefold.py
@@ -19,7 +19,7 @@ from libcloud.loadbalancer.drivers.cloudstack import CloudStackLBDriver
 
 
 class NinefoldLBDriver(CloudStackLBDriver):
-    "Driver for load balancers on Ninefold's Compute platform."
+    """Driver for load balancers on Ninefold's Compute platform."""
 
     host = 'api.ninefold.com'
     path = '/compute/v1.0/'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/test/common/test_upcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/test/common/test_upcloud.py b/libcloud/test/common/test_upcloud.py
index 4a2acb1..60a9ea9 100644
--- a/libcloud/test/common/test_upcloud.py
+++ b/libcloud/test/common/test_upcloud.py
@@ -241,7 +241,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
         self.mock_operations.destroy_node.assert_called_once_with(1)
 
     def test_reuse(self):
-        "Verify that internal flag self.destroyer._stop_node is handled properly"
+        """Verify that internal flag self.destroyer._stop_node is handled properly"""
         self.mock_operations.get_node_state.side_effect = ['started', 'stopped', 'started',
'stopped']
         self.assertTrue(self.destroyer.destroy_node(1))
         self.assertTrue(self.destroyer.destroy_node(1))
@@ -255,7 +255,7 @@ class TestUpcloudNodeDestroyer(unittest.TestCase):
         self.assertRaises(UpcloudTimeoutException, self.destroyer.destroy_node, 1)
 
     def test_timeout_reuse(self):
-        "Verify sleep count is handled properly"
+        """Verify sleep count is handled properly"""
         self.mock_operations.get_node_state.side_effect = ['maintenance'] * 50
         self.assertRaises(UpcloudTimeoutException, self.destroyer.destroy_node, 1)
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c2cbd9c/libcloud/test/compute/test_profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_profitbricks.py b/libcloud/test/compute/test_profitbricks.py
index 0ece89d..62629de 100644
--- a/libcloud/test/compute/test_profitbricks.py
+++ b/libcloud/test/compute/test_profitbricks.py
@@ -45,9 +45,9 @@ class ProfitBricksTests(unittest.TestCase):
 
     def test_list_images(self):
 
-        '''
+        """
         Fetch all images and then fetch with filters
-        '''
+        """
         all_images = self.driver.list_images()
         hdd_images = self.driver.list_images('HDD')
         cdd_images = self.driver.list_images('CDROM')
@@ -617,9 +617,9 @@ class ProfitBricksTests(unittest.TestCase):
         self.assertIn('Resource does not exist', cm.exception.message.value)
 
     def _verify_snapshot(self, snapshot):
-        '''
+        """
         Standard properties
-        '''
+        """
         self.assertEqual(
             snapshot.id,
             'sshot'
@@ -3463,9 +3463,9 @@ class ProfitBricksTests(unittest.TestCase):
         self.assertIn('Resource does not exist', cm.exception.message.value)
 
     def _verify_load_balancer(self, load_balancer):
-        '''
+        """
         Standard properties
-        '''
+        """
         self.assertEqual(
             load_balancer.id,
             'bal-1'


Mime
View raw message