stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject stratos git commit: Remove tenant unsubscribe event which is replace by appplication signup removal event
Date Thu, 05 Feb 2015 09:35:58 GMT
Repository: stratos
Updated Branches:
  refs/heads/master d37767bd4 -> 89223c3d0


Remove tenant unsubscribe event which is replace by appplication signup removal event


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/89223c3d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/89223c3d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/89223c3d

Branch: refs/heads/master
Commit: 89223c3d0de0b0af15d4b975bdcc22c934d8b533
Parents: d37767b
Author: Gayan Gunarathne <gayang@wso2.com>
Authored: Thu Feb 5 15:05:35 2015 +0530
Committer: Gayan Gunarathne <gayang@wso2.com>
Committed: Thu Feb 5 15:05:35 2015 +0530

----------------------------------------------------------------------
 .../cartridgeagent/cartridgeagent/agent.py          |  9 ---------
 .../modules/extensions/abstractextensionhandler.py  |  5 +----
 .../modules/extensions/defaultextensionhandler.py   | 14 --------------
 .../cartridgeagent/modules/util/extensionutils.py   | 16 ----------------
 4 files changed, 1 insertion(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/89223c3d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/agent.py
b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/agent.py
index 8cfc9a6..69d0c7a 100644
--- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/agent.py
@@ -282,7 +282,6 @@ class CartridgeAgent(threading.Thread):
         self.__tenant_event_subscriber.register_handler("SubscriptionDomainsRemovedEvent",
self.on_subscription_domain_removed)
         self.__tenant_event_subscriber.register_handler("CompleteTenantEvent", self.on_complete_tenant)
         self.__tenant_event_subscriber.register_handler("TenantSubscribedEvent", self.on_tenant_subscribed)
-        self.__tenant_event_subscriber.register_handler("TenantUnSubscribedEvent", self.on_tenant_unsubscribed)
         self.__tenant_event_subscriber.register_handler("ApplicationSignUpRemovedEvent",self.on_application_signup_removed)
 
         self.__tenant_event_subscriber.start()
@@ -326,14 +325,6 @@ class CartridgeAgent(threading.Thread):
         except:
             self.log.exception("Error processing tenant subscribed event")
 
-    def on_tenant_unsubscribed(self, msg):
-        self.log.debug("Tenant unSubscribed event received: %r" % msg.payload)
-        event_obj = TenantUnsubscribedEvent.create_from_json(msg.payload)
-        try:
-            CartridgeAgent.extension_handler.on_tenant_unsubscribed_event(event_obj)
-        except:
-            self.log.exception("Error processing tenant unSubscribed event")
-
     def on_application_signup_removed(self, msg):
         self.log.debug("Application signup removed event received: %r" % msg.payload)
         event_obj = ApplicationSignUpRemovedEvent.create_from_json(msg.payload)

http://git-wip-us.apache.org/repos/asf/stratos/blob/89223c3d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/abstractextensionhandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/abstractextensionhandler.py
b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/abstractextensionhandler.py
index 8b00dfc..50350f0 100644
--- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/abstractextensionhandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/abstractextensionhandler.py
@@ -72,10 +72,7 @@ class AbstractExtensionHandler:
         raise NotImplementedError
 
     def on_tenant_subscribed_event(self, tenant_subscribed_event):
-            raise NotImplementedError
-
-    def on_tenant_unsubscribed_event(self, tenant_unsubscribed_event):
-            raise NotImplementedError
+        raise NotImplementedError
 
     def on_application_signup_removal_event(self, tenant_unsubscribed_event):
         raise NotImplementedError

http://git-wip-us.apache.org/repos/asf/stratos/blob/89223c3d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/defaultextensionhandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/defaultextensionhandler.py
b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/defaultextensionhandler.py
index e18a8b5..5a85b63 100644
--- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/defaultextensionhandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/extensions/defaultextensionhandler.py
@@ -345,20 +345,6 @@ class DefaultExtensionHandler(AbstractExtensionHandler):
 
         extensionutils.execute_tenant_subscribed_extension({})
 
-    def on_tenant_unsubscribed_event(self, tenant_unsubscribed_event):
-        self.log.info(
-            "Tenant unsubscribed event received: [tenant] " + tenant_unsubscribed_event.tenant_id
+
-            " [service] " + tenant_unsubscribed_event.service_name +
-            " [cluster] " + tenant_unsubscribed_event.cluster_ids
-        )
-
-        try:
-            if self.cartridge_agent_config.service_name == tenant_unsubscribed_event.service_name:
-                agentgithandler.AgentGitHandler.remove_repo(tenant_unsubscribed_event.tenant_id)
-        except:
-            self.log.exception("Removing git repository failed: ")
-        extensionutils.execute_tenant_unsubscribed_extension({})
-
     def on_application_signup_removal_event(self, application_signup_removal_event):
 
         self.log.info(

http://git-wip-us.apache.org/repos/asf/stratos/blob/89223c3d/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/extensionutils.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/extensionutils.py
b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/extensionutils.py
index d39104d..e12235c 100644
--- a/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/extensionutils.py
+++ b/components/org.apache.stratos.python.cartridge.agent/cartridgeagent/cartridgeagent/modules/util/extensionutils.py
@@ -184,22 +184,6 @@ def execute_tenant_subscribed_extension(env_params):
         log.exception("Could not execute tenant subscribed extension")
 
 
-def execute_tenant_unsubscribed_extension(env_params):
-    try:
-        log.debug("Executing tenant unsubscribed extension")
-
-        script_name = cartridge_agent_config.read_property(
-            cartridgeagentconstants.TENANT_UNSUBSCRIBED_SCRIPT, False)
-        command = prepare_command(script_name)
-        env_params = add_payload_parameters(env_params)
-        env_params = clean_process_parameters(env_params)
-
-        output, errors = execute_command(command, env_params)
-        log.debug("Tenant unsubscribed script returned: %r" % output)
-    except:
-        log.exception("Could not execute tenant unsubscribed extension")
-
-
 def execute_application_signup_removal_extension(env_params):
     try:
         log.debug("Executing tenant unsubscribed extension")


Mime
View raw message