Return only first element of the hostname from all possible list.

    :return:

def generate_minion_id():
    '''
    Return only first element of the hostname from all possible list.

    :return:
    '''
    try:
        ret = salt.utils.stringutils.to_unicode(_generate_minion_id().first())
    except TypeError:
        ret = None
    return ret or 'localhost'