def listener_dict_to_tuple(listener):
 if ('instance_protocol' not in listener):
  instance_protocol = listener['elb_protocol'].upper()
 else:
  instance_protocol = listener['instance_protocol'].upper()
 listener_tuple = [listener['elb_port'], listener['instance_port'], listener['elb_protocol'], instance_protocol]
 if ('certificate' in listener):
  listener_tuple.append(listener['certificate'])
 return tuple(listener_tuple)

def listener_dict_to_tuple ( listener ) : if ( 'instance_protocol' not in listener ) : instance_protocol = listener [ 'elb_protocol' ] . upper ( ) else : instance_protocol = listener [ 'instance_protocol' ] . upper ( ) listener_tuple = [ listener [ 'elb_port' ] , listener [ 'instance_port' ] , listener [ 'elb_protocol' ] , instance_protocol ] if ( 'certificate' in listener ) : listener_tuple . append ( listener [ 'certificate' ] ) return tuple ( listener_tuple )
convert an elb listener dict into a listener tuple used by certain parts of the aws elb api .