You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/02/14 15:27:46 UTC
[2/2] stratos git commit: PCA - Fixes in Agent Git Handler password
decryption and clone
PCA - Fixes in Agent Git Handler password decryption and clone
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/8a604b0c
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/8a604b0c
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/8a604b0c
Branch: refs/heads/master
Commit: 8a604b0cb800550208bbdb06505e93d5bc1fb4a4
Parents: 077f74f
Author: Chamila de Alwis <ch...@wso2.com>
Authored: Fri Feb 13 11:32:49 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sat Feb 14 19:57:38 2015 +0530
----------------------------------------------------------------------
.../cartridge.agent/modules/artifactmgt/git/agentgithandler.py | 2 +-
.../cartridge.agent/modules/util/cartridgeagentutils.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/8a604b0c/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index ecb30df..19de950 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -188,7 +188,7 @@ class AgentGitHandler:
GitUtils.delete_folder_tree(git_repo.local_repo_path)
try:
- Repo.clone_from(unicode(git_repo.repo_url, "utf-8"), unicode(git_repo.local_repo_path, "utf-8"))
+ Repo.clone_from(git_repo.repo_url, git_repo.local_repo_path)
AgentGitHandler.add_repo(git_repo)
AgentGitHandler.log.info("Git clone operation for tenant %s successful" % git_repo.tenant_id)
return git_repo
http://git-wip-us.apache.org/repos/asf/stratos/blob/8a604b0c/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
index 08b87ea..f8a4078 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/cartridgeagentutils.py
@@ -20,6 +20,7 @@ import base64
import os
import time
import socket
+import string
from log import LogFactory
@@ -54,8 +55,10 @@ def decrypt_password(pass_str, secret):
except:
log.exception("Exception occurred while decrypting password")
+ # remove nonprintable characters that are padded in the decrypted password
+ dec_pass = filter(lambda x: x in string.printable, dec_pass)
log.debug("Decrypted PWD: [%r]" % dec_pass)
- return unicode(dec_pass, "utf-8")
+ return dec_pass
def wait_until_ports_active(ip_address, ports, ports_check_timeout=600000):