#NEWLINE# def validates_staticroute( obj ) : #NEWLINE# #INDENT# checker = Checker ( ) #NEWLINE# check = True #NEWLINE# _ = obj . _ #NEWLINE# checker . errors = [ ] #NEWLINE# if ( not is_param ( obj . input , 'target' ) ) : #NEWLINE# #INDENT# check = False #NEWLINE# checker . add_error ( _ ( 'Specify target address for the route.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# check = ( checker . check_ipaddr ( _ ( 'Target' ) , obj . input . target , ( CHECK_EMPTY | CHECK_VALID ) ) and check ) #NEWLINE# #UNINDENT# if ( not is_param ( obj . input , 'gateway' ) ) : #NEWLINE# #INDENT# check = False #NEWLINE# checker . add_error ( _ ( 'Specify gateway address for the route.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# check = ( checker . check_ipaddr ( _ ( 'Gateway' ) , obj . input . gateway , CHECK_VALID ) and check ) #NEWLINE# #UNINDENT# obj . view . alert = checker . errors #NEWLINE# return checker