'Formats listener as a 4- or 5-tuples, in the order specified by the
ELB API'

def _listener_as_tuple(self, listener):

    listener_list = [int(listener['load_balancer_port']), int(listener['instance_port']), str(listener['protocol'].upper())]
    if ('instance_protocol' in listener):
        listener_list.append(str(listener['instance_protocol'].upper()))
    else:
        listener_list.append(str(listener['protocol'].upper()))
    if ('ssl_certificate_id' in listener):
        listener_list.append(str(listener['ssl_certificate_id']))
    return tuple(listener_list)
