Skip to content
Permalink
Browse files
Merge cloudstack.__init__.py
  • Loading branch information
brogand93 committed Mar 5, 2014
1 parent b14bd18 commit 563ee7530a136cedbdf0c3fd19b342f2d9a9a64c
Showing 1 changed file with 5 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, {})
response = describe_items_request(args, {})

return response

@@ -34,19 +34,19 @@ def _describe_specific_item(args, keyname, not_found, prefix):


def describe_item_request(args, keyname, not_found):
request = _describe_items_request(args, not_found)
request = describe_items_request(args, not_found)
request = request[keyname]

for item in request:
if 'id' in args and args['id'] == item['id']:
if 'id' in args and args['id'].lower() == item['id'].lower():
return item
elif 'name' in args and args['name'] == item['name']:
elif 'name' in args and args['name'].lower() == item['name'].lower():
return item

return not_found()


def _describe_items_request(args, not_found):
def describe_items_request(args, not_found):
args['listAll'] = 'true'
response = requester.make_request(args)
response = response[response.keys()[0]]

0 comments on commit 563ee75

Please sign in to comment.