#NEWLINE# def format_network( sl_vlan , tenant_id ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'admin_state_up' : True , #NEWLINE# 'id' : str ( sl_vlan . get ( 'id' ) ) , #NEWLINE# 'name' : sl_vlan . get ( 'name' ) , #NEWLINE# 'shared' : False , #NEWLINE# 'status' : 'ACTIVE' , #NEWLINE# 'subnets' : [ str ( subnet [ 'id' ] ) for subnet in sl_vlan [ 'subnets' ] ] , #NEWLINE# 'tenant_id' : tenant_id , #NEWLINE# 'provider:network_type' : 'vlan' , #NEWLINE# 'provider:segmentation_id' : sl_vlan . get ( 'vlanNumber' ) , #NEWLINE# 'provider:physical_network' : ( sl_vlan [ 'networkSpace' ] == 'PRIVATE' ) , #NEWLINE# #UNINDENT# }