def METHOD_NAME(binary_mac):
    """Converts a binary string MAC address to hex string.
    If the binary string exceeds 6 octets, only the last 6 octets are
    converted. If the string contains less than 6 octets the result will be
    padded with leading zeros.
    """
    if binary_mac:
        binary_mac = binary_mac[-6:].rjust(MAX_MAC_ADDRESS_LENGTH, b'\x00')
        return ":".join("%02x" % x for x in binary_mac)