Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'''
if response is None or response.body is None:
return None
queues = _list()
list_element = ETree.fromstring(response.body)
# Set next marker
next_marker = list_element.findtext('NextMarker') or None
setattr(queues, 'next_marker', next_marker)
queues_element = list_element.find('Queues')
for queue_element in queues_element.findall('Queue'):
# Name element
queue = Queue()
queue.name = queue_element.findtext('Name')
# Metadata
metadata_root_element = queue_element.find('Metadata')
if metadata_root_element is not None:
queue.metadata = dict()
for metadata_element in metadata_root_element:
queue.metadata[metadata_element.tag] = metadata_element.text
# Add queue to list
queues.append(queue)
return queues