#NEWLINE# def convert_old_style( self , conf_arr ) : #NEWLINE# #INDENT# dop = DictOp ( ) #NEWLINE# dop . addconf ( '__' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# orders = [ ] #NEWLINE# for cnt in range ( 0 , 20 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# exec ( ( "action  = conf_arr['ADDRESS%d']['action']" % cnt ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# action = None #NEWLINE# #UNINDENT# exec ( ( "address = conf_arr['ADDRESS%d']['value']" % cnt ) ) #NEWLINE# exec ( ( "netmask = conf_arr['NETMASK%d']['value']" % cnt ) ) #NEWLINE# exec ( ( "gateway = conf_arr['GATEWAY%d']['value']" % net ) ) #NEWLINE# target = ( '%s/%s' % ( address , netmask ) ) #NEWLINE# net = NetworkAddress ( target ) #NEWLINE# try : #NEWLINE# #INDENT# target = net . cidr #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# dop . add ( '__' , [ target ] , gateway ) #NEWLINE# if ( action == 'delete' ) : #NEWLINE# #INDENT# dop . delete ( '__' , [ target ] ) #NEWLINE# #UNINDENT# orders . append ( [ target ] ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# if ( len ( orders ) != 0 ) : #NEWLINE# #INDENT# dop . add ( '__' , [ '@ORDERS' ] , orders ) #NEWLINE# #UNINDENT# return dop . getconf ( '__' )