code: def get_groupaliases(self, hostgroups):
          group_aliases = []
          for hostgroup_id in self.hostgroups:
              hostgroup = hostgroups[hostgroup_id]
              group_aliases.append(hostgroup.alias)
          return ','.join(sorted(group_aliases))