You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2014/09/20 22:19:40 UTC

[08/10] git commit: GCE: ex_create_firewall: allow creation og firewalls with sourceRanges = [], preserve behavior for sourceRanges = None, preserve default value.

GCE: ex_create_firewall: allow creation og firewalls with sourceRanges = [], preserve behavior for sourceRanges = None, preserve default value.

GCE documentation states that firewall allows traffic
if it matches either sourceRanges or sourceTags values.
Thus, sourceRanges = [] is a valid parameter value.

Although it would be better to simply set ["0.0.0.0/0"]
as the default, for minimal API breakage, None value is
still supported.

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: a48481e9cbb7bf6ff464475d295c10b1152d93da
Parents: d8e8987
Author: Evgeny Egorochkin <ph...@yandex.ru>
Authored: Wed Jul 2 23:52:18 2014 +0300
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sat Sep 20 22:06:37 2014 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/gce.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a48481e9/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index e3de515..fc2bc82 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -1058,7 +1058,9 @@ class GCENodeDriver(NodeDriver):
         firewall_data['name'] = name
         firewall_data['allowed'] = allowed
         firewall_data['network'] = nw.extra['selfLink']
-        firewall_data['sourceRanges'] = source_ranges or ['0.0.0.0/0']
+        if source_ranges is None:
+            source_ranges = ['0.0.0.0/0']
+        firewall_data['sourceRanges'] = source_ranges
         if source_tags is not None:
             firewall_data['sourceTags'] = source_tags
         if target_tags is not None: