def METHOD_NAME(cluster, system_paasta_config):
    masters, output = calculate_remote_masters(cluster, system_paasta_config)
    if not masters:
        print("ERROR: %s" % output)
        sys.exit(1)
    mesos_master, output = find_connectable_master(masters)
    if not mesos_master:
        print(
            f"ERROR: could not find connectable master in cluster {cluster}\nOutput: {output}"
        )
        sys.exit(1)
    return mesos_master