You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ch...@apache.org on 2015/12/21 11:53:02 UTC

[2/4] stratos git commit: PCA - Fix log entries for MB connectivity

PCA - Fix log entries for MB connectivity


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

Branch: refs/heads/master
Commit: 4664e6a67690cb5e70fdf1325e092f6f094fc5bf
Parents: 258f5b4
Author: Chamila de Alwis <ch...@apache.org>
Authored: Mon Dec 21 15:50:50 2015 +0530
Committer: Chamila de Alwis <ch...@apache.org>
Committed: Mon Dec 21 15:50:50 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/cartridge.agent/config.py   |  6 +++---
 .../modules/event/eventhandler.py               |  2 +-
 .../cartridge.agent/subscriber.py               |  4 ++--
 .../AgentConfBackwardCompatibilityTestCase.java | 22 --------------------
 4 files changed, 6 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4664e6a6/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
index d6a751d..23283cb 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/config.py
@@ -257,10 +257,10 @@ class Config:
         return value_string
 
     @staticmethod
-    def read_property(property_key, critical=True):
+    def read_property(property_key, mandatory=True):
         """
         Returns the value of the provided property
-        :param critical: If absence of this value should throw an error
+        :param mandatory: If absence of this value should throw an error
         :param str property_key: the name of the property to be read
         :return: Value of the property
         :exception: ParameterNotFoundException if the provided property cannot be found
@@ -280,7 +280,7 @@ class Config:
                 return real_value
 
         # real value is None
-        if critical:
+        if mandatory:
             raise ParameterNotFoundException("Cannot find the value of required parameter: %r" % property_key)
         else:
             return None

http://git-wip-us.apache.org/repos/asf/stratos/blob/4664e6a6/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
index 4e5bdd8..4e55bad 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
@@ -197,7 +197,7 @@ def on_complete_topology_event(complete_topology_event):
                 "Member initialized [member id] %s, [cluster-id] %s, [service] %s"
                 % (member_id_in_payload, cluster_id_in_payload, service_name_in_payload))
         else:
-            log.info("Member not initialized in topology.......")
+            log.info("Member not initialized in topology.")
 
     topology = complete_topology_event.get_topology()
     service = topology.get_service(service_name_in_payload)

http://git-wip-us.apache.org/repos/asf/stratos/blob/4664e6a6/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/subscriber.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/subscriber.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/subscriber.py
index aa1c04a..165cd5b 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/subscriber.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/subscriber.py
@@ -168,9 +168,9 @@ class EventSubscriber(threading.Thread):
                     return mb_client, mb_ip, mb_port
                 except:
                     # The message broker didn't respond well
-                    EventSubscriber.log.debug("Could not connect to the message broker at %s:%s." % (mb_ip, mb_port))
+                    EventSubscriber.log.info("Could not connect to the message broker at %s:%s." % (mb_ip, mb_port))
 
-            EventSubscriber.log.debug(
+            EventSubscriber.log.error(
                 "Could not connect to any of the message brokers provided. Retrying in %s seconds." % retry_interval)
 
             time.sleep(retry_interval)

http://git-wip-us.apache.org/repos/asf/stratos/blob/4664e6a6/products/python-cartridge-agent/modules/integration/test-integration/src/test/java/org/apache/stratos/python/cartridge/agent/integration/tests/AgentConfBackwardCompatibilityTestCase.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/modules/integration/test-integration/src/test/java/org/apache/stratos/python/cartridge/agent/integration/tests/AgentConfBackwardCompatibilityTestCase.java b/products/python-cartridge-agent/modules/integration/test-integration/src/test/java/org/apache/stratos/python/cartridge/agent/integration/tests/AgentConfBackwardCompatibilityTestCase.java
index 2d955b5..c390449 100644
--- a/products/python-cartridge-agent/modules/integration/test-integration/src/test/java/org/apache/stratos/python/cartridge/agent/integration/tests/AgentConfBackwardCompatibilityTestCase.java
+++ b/products/python-cartridge-agent/modules/integration/test-integration/src/test/java/org/apache/stratos/python/cartridge/agent/integration/tests/AgentConfBackwardCompatibilityTestCase.java
@@ -123,12 +123,6 @@ public class AgentConfBackwardCompatibilityTestCase extends PythonAgentIntegrati
                                 publishEvent(memberInitializedEvent);
                                 log.info("Member initialized event published");
                             }
-
-                            // Send artifact updated event to activate the instance first
-                            if (line.contains("Artifact repository found")) {
-                                publishEvent(getArtifactUpdatedEventForPrivateRepo());
-                                log.info("Artifact updated event published");
-                            }
                         }
                     }
                     sleep(1000);
@@ -143,20 +137,4 @@ public class AgentConfBackwardCompatibilityTestCase extends PythonAgentIntegrati
             sleep(2000);
         }
     }
-
-    public static ArtifactUpdatedEvent getArtifactUpdatedEventForPrivateRepo() {
-        ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
-        privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
-        privateRepoEvent.setRepoUserName("testapache2211");
-//        privateRepoEvent.setRepoPassword("+to2qVW16jzy+Xb/zuafQQ==");
-        privateRepoEvent.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
-        return privateRepoEvent;
-    }
-
-    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
-        ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
-        artifactUpdatedEvent.setClusterId(CLUSTER_ID);
-        artifactUpdatedEvent.setTenantId(TENANT_ID);
-        return artifactUpdatedEvent;
-    }
 }