def list_of_target_hosts_sc_fqdn_ip(root):
    """
    Function returns list of target hosts as dictionary of fqdn and ip. Works only if nessus file comes from Tenable.sc.
    :param root: root element of scan file tree
    :return: dictionary of fqdn and ip
    """
    target_list = []
    target_hosts = root[0].find(
        "Preferences/ServerPreferences/preference/[name='TARGET']/value")
    if target_hosts is not None:
        target_hosts = target_hosts.text
        target_hosts_splitted = target_hosts.split(',')
        for target in target_hosts_splitted:
            target_splitted = target[:-1].split('[')
            if len(target_splitted) == 2:
                target_list.append({'target_fqdn': target_splitted[0],
                    'target_ip': target_splitted[1]})
    else:
        target_list = None
    return target_list
