Ejemplo n.º 1
0
    def _refresh_on_all_instances(self, context, configuration_id):
        """Refresh a configuration group on all single instances.
        """
        single_instances = instances_models.DBInstance.find_all(
            tenant_id=context.project_id,
            configuration_id=configuration_id,
            cluster_id=None,
            deleted=False).all()

        config = models.Configuration(context, configuration_id)
        for dbinstance in single_instances:
            LOG.info("Re-applying configuration %s to instance: %s",
                     configuration_id, dbinstance.id)
            instance = instances_models.Instance.load(context, dbinstance.id)
            instance.update_configuration(config)
Ejemplo n.º 2
0
    def _refresh_on_all_instances(self, context, configuration_id):
        """Refresh a configuration group on all its instances.
        """
        dbinstances = instances_models.DBInstance.find_all(
            tenant_id=context.tenant,
            configuration_id=configuration_id,
            deleted=False).all()

        LOG.debug(
            "All instances with configuration group '%s' on tenant '%s': %s" %
            (configuration_id, context.tenant, dbinstances))

        config = models.Configuration(context, configuration_id)
        for dbinstance in dbinstances:
            LOG.debug("Applying configuration group '%s' to instance: %s" %
                      (configuration_id, dbinstance.id))
            instance = instances_models.Instance.load(context, dbinstance.id)
            instance.update_overrides(config)