Merge lp:~gz/goamz/instance_group_filter into lp:goamz
Proposed by
Martin Packman
Status: | Merged |
---|---|
Merged at revision: | 42 |
Proposed branch: | lp:~gz/goamz/instance_group_filter |
Merge into: | lp:goamz |
Diff against target: |
49 lines (+14/-2) 2 files modified
ec2/ec2t_test.go (+12/-0) ec2/ec2test/server.go (+2/-2) |
To merge this branch: | bzr merge lp:~gz/goamz/instance_group_filter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
goamz maintainers | Pending | ||
Review via email: mp+188935@code.launchpad.net |
Description of the change
ec2: support instance prefix on group filters
The EC2 API documentation allows for alternative spellings of
the group-name and group-id filters on instances. It seems only
the prefixed forms are actually supported when using default VPC
despite claims to the contrary, so add support for them to the
test server infrastructure.
To post a comment you must log in.
Reviewers: mp+188935_ code.launchpad. net,
Message:
Please take a look.
Description:
ec2: support instance prefix on group filters
The EC2 API documentation allows for alternative spellings of
the group-name and group-id filters on instances. It seems only
the prefixed forms are actually supported when using default VPC
despite claims to the contrary, so add support for them to the
test server infrastructure.
https:/ /code.launchpad .net/~gz/ goamz/instance_ group_filter/ +merge/ 188935
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14304043/
Affected files (+16, -2 lines): server. go
A [revision details]
M ec2/ec2t_test.go
M ec2/ec2test/
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: ec2/ec2t_test.go group-id" , []string{ group1. Id}}, "group- name", []string{ group1. Name}}, group-name" , []string{ group1. Name}},
=== modified file 'ec2/ec2t_test.go'
--- ec2/ec2t_test.go 2013-08-15 15:35:52 +0000
+++ ec2/ec2t_test.go 2013-10-02 21:34:26 +0000
@@ -385,12 +385,24 @@
},
resultIds: ids(0, 1),
}, {
+ about: "check that filtering on group id with instance prefix works",
+ filters: []filterSpec{
+ {"instance.
+ },
+ resultIds: ids(0, 1),
+ }, {
about: "check that filtering on group name works",
filters: []filterSpec{
{
},
resultIds: ids(0, 1),
}, {
+ about: "check that filtering on group name with instance prefix works",
+ filters: []filterSpec{
+ {"instance.
+ },
+ resultIds: ids(0, 1),
+ }, {
about: "check that filtering on image id works",
filters: []filterSpec{
{"image-id", []string{imageId}},
Index: ec2/ec2test/ server. go server. go' server. go 2013-08-15 16:29:50 +0000 server. go 2013-10-02 21:34:26 +0000 group-id" , "group-id": n.groups { group-name" , "group-name": n.groups {
=== modified file 'ec2/ec2test/
--- ec2/ec2test/
+++ ec2/ec2test/
@@ -569,14 +569,14 @@
return value == "i386", nil
case "instance-id":
return inst.id() == value, nil
- case "group-id":
+ case "instance.
for _, g := range inst.reservatio
if g.id == value {
return true, nil
}
}
return false, nil
- case "group-name":
+ case "instance.
for _, g := range inst.reservatio
if g.name == value {
return true, nil