Merge lp://staging/~franciscosouza/txaws/txaws-secgroupid into lp://staging/txaws
Proposed by
Francisco Souza
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~franciscosouza/txaws/txaws-secgroupid |
Merge into: | lp://staging/txaws |
Diff against target: |
279 lines (+104/-14) 5 files modified
txaws/ec2/client.py (+20/-6) txaws/ec2/model.py (+2/-1) txaws/ec2/tests/test_client.py (+71/-3) txaws/ec2/tests/test_model.py (+6/-4) txaws/testing/payload.py (+5/-0) |
To merge this branch: | bzr merge lp://staging/~franciscosouza/txaws/txaws-secgroupid |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
txAWS Committers | Pending | ||
Review via email: mp+133542@code.staging.launchpad.net |
Description of the change
ec2: recognize ID on security groups
When using VPC, security groups are identified by ID, not name.
To post a comment you must log in.
Unmerged revisions
- 156. By Francisco Souza
-
ec2: added docs for new parameters
- 155. By Francisco Souza
-
ec2: support vpc_id on create_
security_ group - 154. By Francisco Souza
-
ec2: return the id of the group on create_
security_ group - 153. By Francisco Souza
-
ec2: make delete_
security_ group support deletion by ID VPC uses ID for identifying groups, always.
- 152. By Francisco Souza
-
ec2: add support for ID in describe_
security_ groups
Reviewers: mp+133542_ code.launchpad. net,
Message:
Please take a look.
Description:
ec2: recognize ID on security groups
When using VPC, security groups are identified by ID, not name.
https:/ /code.launchpad .net/~francisco souza/txaws/ txaws-secgroupi d/+merge/ 133542
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6822097/
Affected files: tests/test_ client. py tests/test_ model.py payload. py
A [revision details]
M txaws/ec2/client.py
M txaws/ec2/model.py
M txaws/ec2/
M txaws/ec2/
M txaws/testing/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: txaws/ec2/client.py ec2/client. py' self.parser. truth_return)
=== modified file 'txaws/
--- txaws/ec2/client.py 2012-05-05 00:17:02 +0000
+++ txaws/ec2/client.py 2012-11-08 18:46:21 +0000
@@ -125,13 +125,18 @@
d = query.submit()
return d.addCallback(
- def delete_ security_ group(self, name): security_ group(self, name=None, id=None):
success of the operation.
action= "DeleteSecurity Group", creds=self.creds,
endpoint= self.endpoint, other_params= parameter) "securityGroupI nfo/item" ): findtext( "groupId" ) findtext( "groupName" )
description = group_info. findtext( "groupDescripti on")
owner_id = group_info. findtext( "ownerId" )
for user_id, group_name in allowed_groups]
+ def delete_
"""
@param name: Name of the new security group.
@return: A C{Deferred} that will fire with a truth value for the
"""
- parameter = {"GroupName": name}
+ if name:
+ parameter = {"GroupName": name}
+ elif id:
+ parameter = {"GroupId": id}
+ else:
+ raise ValueError("You must provide either the security group
name or id")
query = self.query_factory(
@@ -670,6 +675,7 @@
root = XML(xml_bytes)
result = []
for group_info in root.findall(
+ id = group_info.
name = group_info.
@@ -709,7 +715,7 @@
- name, description, owner_id=owner_id,
+ id, name, description, owner_id=owner_id,
return result
Index: txaws/ec2/model.py ec2/model. py'
self. description = description
=== modified file 'txaws/
--- txaws/ec2/model.py 2012-03-02 22:00:10 +0000
+++ txaws/ec2/model.py 2012-11-08 18:37:45 +0000
@@ -80,7 +80,8 @@
@ivar allowed_ips: The sequence of L{IPPermission} instances for this
security group.
"""
- def __init__(self, name, description, owner_id="", groups=None,
ips=None):
+ def __init__(self, id, name, description, owner_id="", groups=None,
ips=None):
+ self.id = id
self.name = name
...