Skip to content
Permalink
Browse files
Merge branch 'master' of github.com:imduffy14/ec2stack
* 'master' of github.com:imduffy15/ec2stack:
  Fix name in security_groups.py
  Merge cloudstack.__init__.py
  Return empty set, instead of error if description of items is empty
  • Loading branch information
imduffy15 committed Mar 5, 2014
2 parents b1f50cf + f38734d commit 2fb2d3e52e9ea02b4d5ebee80298c2ab3a906f1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
@@ -9,7 +9,7 @@ def describe_item(args, keyname, not_found, prefix):
if helpers.contains_parameter_with_keyword(prefix):
response = _describe_specific_item(args, keyname, not_found, prefix)
else:
response = describe_items_request(args, not_found)
response = describe_items_request(args, {})

return response

@@ -53,5 +53,7 @@ def describe_items_request(args, not_found):

if 'count' in response:
return response
else:
elif callable(not_found):
return not_found()
else:
return not_found
@@ -78,12 +78,12 @@ def describe_security_groups():
args, 'securitygroup', errors.invalid_security_group, 'Group'
)

return _describe_images_response(
return _describe_security_groups_response(
response
)


def _describe_images_response(response):
def _describe_security_groups_response(response):
return {
'template_name_or_list': 'securitygroups.xml',
'response_type': 'DescribeSecurityGroupsResponse',
@@ -1,6 +1,7 @@
{% extends "response.xml" %}
{% block response_content %}
<reservationSet>
{% if response %}
<item>
<reservationId>None</reservationId>
<instancesSet>
@@ -52,5 +53,6 @@
{% endfor %}
</instancesSet>
</item>
{% endif %}
</reservationSet>
{% endblock %}
@@ -75,7 +75,7 @@ def test_invalid_describe_image_by_id(self):
def test_empty_response_describe_images_by_id(self):
data = self.get_example_data()
data['Action'] = 'DescribeImages'
data['InstanceId.1'] = 'invalid-images-id'
data['ImageId.1'] = 'invalid-images-id'
data['Signature'] = generate_signature(data, 'POST', 'localhost')

get = mock.Mock()

0 comments on commit 2fb2d3e

Please sign in to comment.