示例#1
0
 def setUp(self):
     from shinken.objects.hostgroup import Hostgroup
     self.item = Hostgroup()
示例#2
0
        data = b.data
        hgname = data['hostgroup_name']
        inst_id = data['instance_id']

        # Try to get the inp progress Hostgroups
        try:
            inp_hostgroups = self.inp_hostgroups[inst_id]
        except Exception, exp:  # not good. we will cry in theprogram update
            logger.error("[regen] host_check_result:: Not good!   %s" % exp)
            return

        logger.debug("Creating a hostgroup: %s in instance %d" %
                     (hgname, inst_id))

        # With void members
        hg = Hostgroup([])

        # populate data
        self.update_element(hg, data)

        # We will link hosts into hostgroups later
        # so now only save it
        inp_hostgroups[hg.id] = hg

    def manage_initial_broks_done_brok(self, b):
        inst_id = b.data['instance_id']
        print "TECH Finish the configuration of instance", inst_id
        self.all_done_linking(inst_id)

    def all_done_linking(self, inst_id):
        print "TECH all_done_linking", inst_id, self.inp_hosts