#NEWLINE# def set_backend_policy( name , port , policies = None , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# '\n    Set the policies of an ELB backend server.\n\n    CLI example:\n\n        salt myminion boto_elb.set_backend_policy myelb 443 "[policy1,policy2]"\n    ' #NEWLINE# conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) #NEWLINE# if ( not exists ( name , region , key , keyid , profile ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( policies is None ) : #NEWLINE# #INDENT# policies = [ ] #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# conn . set_lb_policies_of_backend_server ( name , port , policies ) #NEWLINE# log . info ( 'Set policies {0} on ELB {1} backend server {2}' . format ( policies , name , port ) ) #NEWLINE# #UNINDENT# except boto . exception . BotoServerError as e : #NEWLINE# #INDENT# log . debug ( e ) #NEWLINE# log . info ( 'Failed to set policy {0} on ELB {1} backend server {2}: {3}' . format ( policies , name , key , e . message ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True