def _get_subnetname_id(subnetname):
 params = {'Action': 'DescribeSubnets'}
 for subnet in aws.query(params, location=get_location(), provider=get_provider(), opts=__opts__, sigver='4'):
  tags = subnet.get('tagSet', {}).get('item', {})
  if (not isinstance(tags, list)):
   tags = [tags]
  for tag in tags:
   if ((tag['key'] == 'Name') and (tag['value'] == subnetname)):
    log.debug('AWS Subnet ID of {0} is {1}'.format(subnetname, subnet['subnetId']))
    return subnet['subnetId']
 return None

def _get_subnetname_id ( subnetname ) : params = { 'Action' : 'DescribeSubnets' } for subnet in aws . query ( params , location = get_location ( ) , provider = get_provider ( ) , opts = __opts__ , sigver = '4' ) : tags = subnet . get ( 'tagSet' , { } ) . get ( 'item' , { } ) if ( not isinstance ( tags , list ) ) : tags = [ tags ] for tag in tags : if ( ( tag [ 'key' ] == 'Name' ) and ( tag [ 'value' ] == subnetname ) ) : log . debug ( 'AWS Subnet ID of {0} is {1}' . format ( subnetname , subnet [ 'subnetId' ] ) ) return subnet [ 'subnetId' ] return None
returns the subnetid of a subnetname to use .