def get_port_attributes(port):
    attributes = []
    if port.description:
        attributes.append("port-name %s" % port.description)
    if port.shutdown is False:
        attributes.append("enable")
    if port.vrf is not None:
        attributes.append("vrf forwarding {}".format(port.vrf.name))
    if isinstance(port, VlanPort):
        for ip in sorted(port.ips, key=lambda e: e.ip):
            attributes.append("ip address %s" % ip)
        for ip in sorted(port.secondary_ips, key=lambda e: e.ip):
            attributes.append("ip address %s secondary" % ip)
        if port.access_group_in:
            attributes.append("ip access-group %s in" % port.access_group_in)
        if port.access_group_out:
            attributes.append("ip access-group %s out" % port.access_group_out)
        if port.vrrp_common_authentication:
            attributes.append("ip vrrp-extended auth-type simple-text-auth ********")
        for vrrp in port.vrrps:
            attributes.append("ip vrrp-extended vrid %s" % vrrp.group_id)
            if vrrp.priority and len(vrrp.track) > 0:
                attributes.append(" backup priority %s track-priority %s" % (vrrp.priority, vrrp.track.values()[0]))
            if vrrp.ip_addresses:
                for ip_address in vrrp.ip_addresses:
                    attributes.append(" ip-address %s" % ip_address)
            if vrrp.advertising:
                attributes.append(" advertise backup")
            if vrrp.timers_hold:
                attributes.append(" dead-interval %s" % vrrp.timers_hold)
            if vrrp.timers_hello:
                attributes.append(" hello-interval %s" % vrrp.timers_hello)
            if len(vrrp.track) > 0 and vrrp.track.keys()[0] is not None:
                attributes.append(" track-port %s" % vrrp.track.keys()[0])
            if vrrp.activated:
                attributes.append(" activate")
            else:
                attributes.append(" exit")
        for ip_address in port.ip_helpers:
            attributes.append("ip helper-address %s" % ip_address)
        if port.ip_redirect is False:
            attributes.append("no ip redirect")

    return attributes
dataset/ETHPy150Open internap/fake-switches/fake_switches/brocade/command_processor/enabled.py/get_port_attributes/original