libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [libcloud] branch trunk updated: Fix DeprecationWarning in unescaped literal and SyntaxWarning over literal is comparison.
Date Mon, 02 Dec 2019 20:37:34 GMT
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


The following commit(s) were added to refs/heads/trunk by this push:
     new 6799001  Fix DeprecationWarning in unescaped literal and SyntaxWarning over literal
is comparison.
     new d4334c0  Merge pull request #1378 from tirkarthi/fix-warnings
6799001 is described below

commit 679900120b0ba5ca3697ed085b2262fa937960aa
Author: Karthikeyan Singaravelan <tir.karthi@gmail.com>
AuthorDate: Sun Dec 1 19:36:59 2019 +0530

    Fix DeprecationWarning in unescaped literal and SyntaxWarning over literal is comparison.
---
 libcloud/compute/drivers/vcloud.py               | 2 +-
 libcloud/test/compute/test_cloudsigma_v1_0.py    | 2 +-
 libcloud/test/compute/test_dimensiondata_v2_3.py | 2 +-
 libcloud/test/compute/test_dimensiondata_v2_4.py | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py
index f574fc6..3d46603 100644
--- a/libcloud/compute/drivers/vcloud.py
+++ b/libcloud/compute/drivers/vcloud.py
@@ -1691,7 +1691,7 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver):
         if names is None:
             return
         hname_re = re.compile(
-            '^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9]*)[\-])*([A-Za-z]|[A-Za-z][A-Za-z0-9]*[A-Za-z0-9])$')
 # NOQA
+            r'^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9]*)[\-])*([A-Za-z]|[A-Za-z][A-Za-z0-9]*[A-Za-z0-9])$')
 # NOQA
         for name in names:
             if len(name) > 15:
                 raise ValueError(
diff --git a/libcloud/test/compute/test_cloudsigma_v1_0.py b/libcloud/test/compute/test_cloudsigma_v1_0.py
index 8a73cdd..71990c2 100644
--- a/libcloud/test/compute/test_cloudsigma_v1_0.py
+++ b/libcloud/test/compute/test_cloudsigma_v1_0.py
@@ -114,7 +114,7 @@ class CloudSigmaAPI10BaseTestCase(object):
         self.assertTrue(result)
 
     def test_str2dicts(self):
-        string = 'mem 1024\ncpu 2200\n\nmem2048\cpu 1100'
+        string = 'mem 1024\ncpu 2200\n\nmem2048\\cpu 1100'
         result = str2dicts(string)
         self.assertEqual(len(result), 2)
 
diff --git a/libcloud/test/compute/test_dimensiondata_v2_3.py b/libcloud/test/compute/test_dimensiondata_v2_3.py
index 3cc08fa..2e0643d 100644
--- a/libcloud/test/compute/test_dimensiondata_v2_3.py
+++ b/libcloud/test/compute/test_dimensiondata_v2_3.py
@@ -2145,7 +2145,7 @@ class DimensionDataMockHttp(MockHttp):
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
     def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url,
body, headers):
-        if method is "POST":
+        if method == "POST":
             request = ET.fromstring(body)
             if request.tag != "{http://oec.api.opsource.net/schemas/network}NewNetworkWithLocation":
                 raise InvalidRequestError(request.tag)
diff --git a/libcloud/test/compute/test_dimensiondata_v2_4.py b/libcloud/test/compute/test_dimensiondata_v2_4.py
index 1924b27..3af04e3 100644
--- a/libcloud/test/compute/test_dimensiondata_v2_4.py
+++ b/libcloud/test/compute/test_dimensiondata_v2_4.py
@@ -2234,7 +2234,7 @@ class DimensionDataMockHttp(MockHttp):
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
     def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url,
body, headers):
-        if method is "POST":
+        if method == "POST":
             request = ET.fromstring(body)
             if request.tag != "{http://oec.api.opsource.net/schemas/network}NewNetworkWithLocation":
                 raise InvalidRequestError(request.tag)


Mime
View raw message