Beispiel #1
0
    def _update_plugins(self, plugins):
        logger.debug("start updating plugins; plugin datas: {}".format(plugins))
        add = plugins.get("add", [])
        try:
            app_plugin_service.create_plugin_4marketsvc(self.service.service_region, self.tenant, self.service,
                                                        self.template["apps"], self.version, add)
        except ServiceHandleException as e:
            logger.exception(e)

        delete = plugins.get("delete", [])
        for plugin in delete:
            app_plugin_service.delete_service_plugin_relation(self.service, plugin["plugin_id"])
            app_plugin_service.delete_service_plugin_config(self.service, plugin["plugin_id"])
Beispiel #2
0
    def _update_plugins(self, plugins):
        logger.debug("start updating plugins; plugin datas: {}".format(plugins))
        add = plugins.get("add", [])
        try:
            app_plugin_service.create_plugin_4marketsvc(
                self.tenant.region, self.tenant, self.service, self.version, add)
        except ErrPluginAlreadyInstalled as e:
            logger.warning("plugin data: {}; failed to create plugin: {}", add, e)

        delete = plugins.get("delete", [])
        for plugin in delete:
            app_plugin_service.delete_service_plugin_relation(self.service,
                                                              plugin["plugin_id"])
            app_plugin_service.delete_service_plugin_config(self.service,
                                                            plugin["plugin_id"])