libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [2/3] libcloud git commit: Add description to ex_authorize_security_group_ingress (same for all cidrIps)
Date Mon, 11 Jun 2018 19:15:30 GMT
Add description to ex_authorize_security_group_ingress (same for all cidrIps)

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

Branch: refs/heads/trunk
Commit: f05cfe6208e593ef4b7ad5c8f825bcfb728c9c50
Parents: 1250374
Author: Arturo Noha <arturo.noha@wandera.com>
Authored: Thu Oct 5 10:58:46 2017 +0100
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Mon Jun 11 21:14:20 2018 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f05cfe62/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index eb21c12..ad0c6dd 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -5070,7 +5070,7 @@ class BaseEC2NodeDriver(NodeDriver):
 
     def ex_authorize_security_group_ingress(self, id, from_port, to_port,
                                             cidr_ips=None, group_pairs=None,
-                                            protocol='tcp'):
+                                            protocol='tcp', description=None):
         """
         Edit a Security Group to allow specific ingress traffic using
         CIDR blocks or either a group ID, group name or user ID (account).
@@ -5112,7 +5112,8 @@ class BaseEC2NodeDriver(NodeDriver):
                                                         from_port,
                                                         to_port,
                                                         cidr_ips,
-                                                        group_pairs)
+                                                        group_pairs,
+                                                        description)
 
         params["Action"] = 'AuthorizeSecurityGroupIngress'
 
@@ -7635,7 +7636,7 @@ class BaseEC2NodeDriver(NodeDriver):
 
     def _get_common_security_group_params(self, group_id, protocol,
                                           from_port, to_port, cidr_ips,
-                                          group_pairs):
+                                          group_pairs, description=None):
         """
         Return a dictionary with common query parameters which are used when
         operating on security groups.
@@ -7654,6 +7655,9 @@ class BaseEC2NodeDriver(NodeDriver):
 
                 ip_ranges['IpPermissions.1.IpRanges.%s.CidrIp'
                           % (index)] = cidr_ip
+                if description is not None:
+                    ip_ranges['IpPermissions.1.IpRanges.%s.Description'
+                          % (index)] = description
 
             params.update(ip_ranges)
 


Mime
View raw message