def get_vlan(driver, locator, location, network_domain):
 if is_uuid(locator):
  vlan_id = locator
 else:
  vlans = driver.ex_list_vlans(location=location, network_domain=network_domain)
  found_vlans = [vlan for vlan in vlans if (vlan.name == locator)]
  if (not found_vlans):
   raise UnknownVLANError(("VLAN '%s' could not be found" % locator))
  vlan_id = found_vlans[0].id
 return driver.ex_get_vlan(vlan_id)

def get_vlan ( driver , locator , location , network_domain ) : if is_uuid ( locator ) : vlan_id = locator else : vlans = driver . ex_list_vlans ( location = location , network_domain = network_domain ) found_vlans = [ vlan for vlan in vlans if ( vlan . name == locator ) ] if ( not found_vlans ) : raise UnknownVLANError ( ( "VLAN '%s' could not be found" % locator ) ) vlan_id = found_vlans [ 0 ] . id return driver . ex_get_vlan ( vlan_id )
get instance of vlan as a dictionary .