if hostgroup is not None:
                    if _get_hgroup(hostgroup, array) is not None:
                        try:
                            array.set_pgroup(name, addhgrouplist=[hostgroup])
                            return True