libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [3/3] libcloud git commit: isinstance accepts tuples which is much cleaner Closes #664
Date Mon, 21 Dec 2015 23:05:04 GMT
isinstance accepts tuples which is much cleaner
Closes #664


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

Branch: refs/heads/trunk
Commit: e943be82dcdde63459217f26782290bd069c2809
Parents: 97c8818
Author: anthony-shaw <anthony.p.shaw@gmail.com>
Authored: Mon Dec 21 20:35:45 2015 +1100
Committer: anthony-shaw <anthony.p.shaw@gmail.com>
Committed: Tue Dec 22 10:04:35 2015 +1100

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e943be82/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index cbe1530..edc85a2 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -137,14 +137,14 @@ class DimensionDataNodeDriver(NodeDriver):
             auth_obj = self._get_and_check_auth(auth)
             password = auth_obj.password
 
-        if not isinstance(ex_network, DimensionDataNetwork) \
-            and not isinstance(ex_network, str):
-            if not isinstance(ex_network_domain, DimensionDataNetworkDomain) \
-                and not isinstance(ex_network_domain, str):
-                raise ValueError('ex_network must be of DimensionDataNetwork'
-                                 ' or str '
-                                 'type or ex_network_domain must be of '
-                                 'DimensionDataNetworkDomain type or str')
+        if not isinstance(ex_network, (DimensionDataNetwork, str)):
+            if not isinstance(ex_network_domain,
+                              (DimensionDataNetworkDomain, str)):
+                raise ValueError(
+                    'ex_network must be of DimensionDataNetwork'
+                    ' or str '
+                    'type or ex_network_domain must be of '
+                    'DimensionDataNetworkDomain type or str')
 
         server_elm = ET.Element('deployServer', {'xmlns': TYPES_URN})
         ET.SubElement(server_elm, "name").text = name


Mime
View raw message