Fixed issues found when testing with Docker container

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

Branch: refs/heads/master
Commit: 191c4c1472363f18ef504abbf603619518d26aa7
Parents: b061371
Author: Chamila de Alwis <[email protected]>
Authored: Fri Oct 10 20:13:08 2014 +0530
Committer: Chamila de Alwis <[email protected]>
Committed: Fri Oct 10 20:13:08 2014 +0530

----------------------------------------------------------------------
 .../cartridge-agent/agent.conf                     |  2 +-
 .../cartridge-agent/logging.ini                    |  2 +-
 .../modules/config/cartridgeagentconfiguration.py  | 17 ++++++++++++-----
 3 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/191c4c14/tools/python-cartridge-agent/cartridge-agent/agent.conf
----------------------------------------------------------------------
diff --git a/tools/python-cartridge-agent/cartridge-agent/agent.conf 
b/tools/python-cartridge-agent/cartridge-agent/agent.conf
index cb7c686..1bb65d8 100644
--- a/tools/python-cartridge-agent/cartridge-agent/agent.conf
+++ b/tools/python-cartridge-agent/cartridge-agent/agent.conf
@@ -38,7 +38,7 @@ monitoring.server.secure.port         
=MONITORING-SERVER-SECURE-PORT
 monitoring.server.admin.username      =MONITORING-SERVER-ADMIN-USERNAME
 monitoring.server.admin.password      =MONITORING-SERVER-ADMIN-PASSWORD
 log.file.paths                        =LOG_FILE_PATHS
-APP_PATH                              =APP_PATH
+APP_PATH                              =APP-PATH
 super.tenant.repository.path          =/repository/deployment/server/
 tenant.repository.path                =/repository/tenants/
 extension.instance.started            =instance-started.sh

http://git-wip-us.apache.org/repos/asf/stratos/blob/191c4c14/tools/python-cartridge-agent/cartridge-agent/logging.ini
----------------------------------------------------------------------
diff --git a/tools/python-cartridge-agent/cartridge-agent/logging.ini 
b/tools/python-cartridge-agent/cartridge-agent/logging.ini
index 2bd3ab4..3e49a96 100644
--- a/tools/python-cartridge-agent/cartridge-agent/logging.ini
+++ b/tools/python-cartridge-agent/cartridge-agent/logging.ini
@@ -33,7 +33,7 @@ args=tuple()
 
 [handler_log_file]
 class=logging.FileHandler
-level=INFO
+level=LOG_LEVEL
 formatter=default
 args=("agent.log", "w")
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/191c4c14/tools/python-cartridge-agent/cartridge-agent/modules/config/cartridgeagentconfiguration.py
----------------------------------------------------------------------
diff --git 
a/tools/python-cartridge-agent/cartridge-agent/modules/config/cartridgeagentconfiguration.py
 
b/tools/python-cartridge-agent/cartridge-agent/modules/config/cartridgeagentconfiguration.py
index f3376cf..95c4169 100644
--- 
a/tools/python-cartridge-agent/cartridge-agent/modules/config/cartridgeagentconfiguration.py
+++ 
b/tools/python-cartridge-agent/cartridge-agent/modules/config/cartridgeagentconfiguration.py
@@ -114,7 +114,7 @@ class CartridgeAgentConfiguration:
                 self.cluster_id = 
self.read_property(cartridgeagentconstants.CLUSTER_ID)
                 self.network_partition_id = 
self.read_property(cartridgeagentconstants.NETWORK_PARTITION_ID)
                 self.partition_id = 
self.read_property(cartridgeagentconstants.PARTITION_ID)
-                self.member_id = 
self.get_member_id(cartridgeagentconstants.MEMBER_ID, self.cluster_id)
+                self.member_id = 
self.get_member_id(cartridgeagentconstants.MEMBER_ID)
                 self.cartridge_key = 
self.read_property(cartridgeagentconstants.CARTRIDGE_KEY)
                 self.app_path = 
self.read_property(cartridgeagentconstants.APP_PATH)
                 self.repo_url = 
self.read_property(cartridgeagentconstants.REPO_URL)
@@ -122,12 +122,12 @@ class CartridgeAgentConfiguration:
 
                 try:
                     self.log_file_paths = str(
-                        
self.read_property(cartridgeagentconstants.CLUSTER_ID)).strip().split("|")
+                        
self.read_property(cartridgeagentconstants.LOG_FILE_PATHS)).strip().split("|")
                 except ParameterNotFoundException as ex:
                     self.log.debug("Cannot read log file path : %r" % 
ex.get_message())
                     self.log_file_paths = None
 
-                is_multi_str = 
self.read_property(cartridgeagentconstants.CLUSTER_ID)
+                is_multi_str = 
self.read_property(cartridgeagentconstants.MULTITENANT)
                 self.is_multitenant = True if 
str(is_multi_str).lower().strip() == "true" else False
 
                 try:
@@ -270,6 +270,7 @@ class CartridgeAgentConfiguration:
             """
 
             param_file = 
self.read_property(cartridgeagentconstants.PARAM_FILE_PATH, False)
+            self.log.debug("Param file path : %r" % param_file)
 
             try:
                 if param_file is not None:
@@ -302,12 +303,18 @@ class CartridgeAgentConfiguration:
                 self.log.debug("Has key: %r" % property_key)
                 temp_str = self.properties.get("agent", property_key)
                 if temp_str != "" and temp_str is not None:
-                    return str(temp_str).strip()
+                    if str(temp_str).strip().lower() == "null":
+                        return ""
+                    else:
+                        return str(temp_str).strip()
 
             if property_key in self.payload_params:
                 temp_str = self.payload_params[property_key]
                 if temp_str != "" and temp_str is not None:
-                    return str(temp_str).strip()
+                    if str(temp_str).strip().lower() == "null":
+                        return ""
+                    else:
+                        return str(temp_str).strip()
 
             if critical:
                 raise ParameterNotFoundException("Cannot find the value of 
required parameter: %r" % property_key)

Reply via email to