def append_hostname(machine_name, num_list):
    """
    Helper method to append the hostname to node numbers.

    :param machine_name: The name of the cluster.
    :param num_list: The list of nodes to be appended to the cluster name.
    :return: A hostlist string with the hostname and node numbers.
    """

    hostlist = []
    for elem in num_list:
        hostlist.append(machine_name + str(elem))

    return '%s' % ','.join(map(str, hostlist))