#NEWLINE# def _remove_associated_networks( self ) : #NEWLINE# #INDENT# 'Delete associated Nova networks from tenants.' #NEWLINE# clients = osclients . Clients ( network_tenant_id . credential ) #NEWLINE# if ( consts . Service . NOVA not in clients . services ( ) . values ( ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# nova_admin = clients . nova ( ) #NEWLINE# if ( not utils . check_service_status ( nova_admin , 'nova-network' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# for net in nova_admin . networks . list ( ) : #NEWLINE# #INDENT# network_tenant_id = nova_admin . networks . get ( net ) . project_id #NEWLINE# if ( network_tenant_id in self . context [ 'tenants' ] ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# nova_admin . networks . disassociate ( net ) #NEWLINE# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# LOG . warning ( ( 'Failed disassociate net: %(tenant_id)s. Exception: %(ex)s' % { #NEWLINE# #INDENT# 'tenant_id' : network_tenant_id , #NEWLINE# 'ex' : ex , #NEWLINE# #UNINDENT# } ) )