Test out py26 with new HTTPretty
This commit is contained in:
parent
fe1f3ec06c
commit
3bddbb4af3
23 changed files with 81 additions and 68 deletions
|
|
@ -7,7 +7,7 @@ def random_id(prefix=''):
|
|||
chars = range(10) + ['a', 'b', 'c', 'd', 'e', 'f']
|
||||
|
||||
instance_tag = ''.join(unicode(random.choice(chars)) for x in range(size))
|
||||
return '{}-{}'.format(prefix, instance_tag)
|
||||
return '{0}-{1}'.format(prefix, instance_tag)
|
||||
|
||||
|
||||
def random_ami_id():
|
||||
|
|
@ -60,9 +60,9 @@ def resource_ids_from_querystring(querystring_dict):
|
|||
for key, value in querystring_dict.iteritems():
|
||||
if key.startswith(prefix):
|
||||
resource_index = key.replace(prefix + ".", "")
|
||||
tag_key = querystring_dict.get("Tag.{}.Key".format(resource_index))[0]
|
||||
tag_key = querystring_dict.get("Tag.{0}.Key".format(resource_index))[0]
|
||||
|
||||
tag_value_key = "Tag.{}.Value".format(resource_index)
|
||||
tag_value_key = "Tag.{0}.Value".format(resource_index)
|
||||
if tag_value_key in querystring_dict:
|
||||
tag_value = querystring_dict.get(tag_value_key)[0]
|
||||
else:
|
||||
|
|
@ -78,7 +78,7 @@ def filters_from_querystring(querystring_dict):
|
|||
match = re.search("Filter.(\d).Name", key)
|
||||
if match:
|
||||
filter_index = match.groups()[0]
|
||||
value_prefix = "Filter.{}.Value".format(filter_index)
|
||||
value_prefix = "Filter.{0}.Value".format(filter_index)
|
||||
filter_values = [filter_value[0] for filter_key, filter_value in querystring_dict.iteritems() if filter_key.startswith(value_prefix)]
|
||||
response_values[value[0]] = filter_values
|
||||
return response_values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue