#NEWLINE# def test_params_for_stanza( p , contx , is_namespace ) : #NEWLINE# #INDENT# for t in p : #NEWLINE# #INDENT# if is_namespace : #NEWLINE# #INDENT# info_code = ( ( ( ( ( 'set-config:context=namespace;id=' + contx ) + ';' ) + t [ 0 ] ) + '=' ) + str ( t [ 1 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# info_code = ( ( ( ( ( 'set-config:context=' + contx ) + ';' ) + t [ 0 ] ) + '=' ) + str ( t [ 1 ] ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# v = list ( client . info ( info_code ) . items ( ) ) #NEWLINE# res = contx [ 0 ] [ 1 ] [ 1 ] #NEWLINE# if ( res != 'ok\n' ) : #NEWLINE# #INDENT# print ( 'setting {0} to {1} failed. Got result({2})' . format ( t [ 0 ] , t [ 1 ] , res ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'setting {0} to {1} succeeded' . format ( t [ 0 ] , t [ 1 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# print ( 'error: info_code({0}) result({1})' . format ( info_code , v ) )