#NEWLINE# def clear_all_flows( self ) : #NEWLINE# #INDENT# ' Delete all existing rules\n            Return:\n                0, None if ok\n                -1, text_error if fails\n        ' #NEWLINE# try : #NEWLINE# #INDENT# of_response = requests . delete ( ( ( ( self . url + '/restconf/config/opendaylight-inventory:nodes/node/' ) + self . id ) + '/table/0' ) , headers = self . headers ) #NEWLINE# error_text = ( 'Openflow response %d: %s' % ( of_response . status_code , of_response . text ) ) #NEWLINE# if ( ( of_response . status_code != 200 ) and ( of_response . status_code != 404 ) ) : #NEWLINE# #INDENT# self . logger . warning ( ( 'clear_all_flows ' + error_text ) ) #NEWLINE# return ( ( - 1 ) , error_text ) #NEWLINE# #UNINDENT# self . logger . debug ( ( 'clear_all_flows OK ' + error_text ) ) #NEWLINE# return ( 0 , None ) #NEWLINE# #UNINDENT# except requests . exceptions . RequestException as e : #NEWLINE# #INDENT# error_text = ( ( type ( e ) . __name__ + ': ' ) + str ( e ) ) #NEWLINE# self . logger . error ( ( 'clear_all_flows ' + e ) ) #NEWLINE# return ( ( - 1 ) , error_text )