'Add the host to the parent group in the given inventory.'

def _add_host(self, inv, parent_group, host_name):

    p_group = inv.setdefault(parent_group, [])
    if isinstance(p_group, dict):
        group_hosts = p_group.setdefault('hosts', [])
    else:
        group_hosts = p_group
    if (host_name not in group_hosts):
        group_hosts.append(host_name)
