libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [1/4] libcloud git commit: Use list comprehension instead of filter().
Date Sun, 25 Feb 2018 18:21:43 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 85180ab61 -> 1eca23bad


Use list comprehension instead of filter().

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

Branch: refs/heads/trunk
Commit: 42bf5642675feb6d4f3dcce4b8e92bcef42d4684
Parents: 0a50225
Author: Adam Friedman <tintoy@tintoy.io>
Authored: Fri Feb 9 14:49:34 2018 +1100
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Sun Feb 25 22:16:15 2018 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/42bf5642/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 2543149..2cd832d 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -4181,7 +4181,7 @@ class DimensionDataNodeDriver(NodeDriver):
         if locations is None:
             locations = self.list_locations(location_id)
 
-        location = filter(lambda x: x.id == location_id, locations)[0]
+        location = [match_location for match_location in locations if match_location.id ==
location_id][0]
         cpu_spec = self._to_cpu_spec(element.find(fixxpath('cpu', TYPES_URN)))
 
         if LooseVersion(self.connection.active_api_version) > LooseVersion(


Mime
View raw message