#NEWLINE# @ classmethod #NEWLINE# @ log_deprecated_resource_type #NEWLINE# def transform( cls , clients , resource_config ) : #NEWLINE# #INDENT# 'Transform the resource config to id.\n\n        :param clients: openstack admin client handles\n        :param resource_config: scenario config with `id`, `name` or `regex`\n\n        :returns: id matching resource\n        ' #NEWLINE# resource_id = resource_config . get ( 'id' ) #NEWLINE# if resource_id : #NEWLINE# #INDENT# return resource_id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# neutronclient = clients . neutron ( ) #NEWLINE# for net in neutronclient . list_networks ( ) [ 'networks' ] : #NEWLINE# #INDENT# if ( net [ 'name' ] == resource_config . get ( 'name' ) ) : #NEWLINE# #INDENT# return net [ 'id' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# raise exceptions . InvalidScenarioArgument ( "Neutron network with name '{name}' not found" . format ( name = resource_config . get ( 'name' ) ) )