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/10/13 21:36:22 UTC
[1/3] stratos git commit: Python CLI - Added connection log and debug
option
Repository: stratos
Updated Branches:
refs/heads/stratos-4.1.x 34c9d560f -> 3a6d92d9e
Python CLI - Added connection log and debug option
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/37814177
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/37814177
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/37814177
Branch: refs/heads/stratos-4.1.x
Commit: 37814177ef84479c66dfdc42c84efa7405d8b93b
Parents: 34c9d56
Author: Chamila de Alwis <ch...@apache.org>
Authored: Wed Oct 14 00:47:00 2015 +0530
Committer: Chamila de Alwis <ch...@apache.org>
Committed: Wed Oct 14 00:47:00 2015 +0530
----------------------------------------------------------------------
.../src/main/python/cli/Configs.py | 1 +
.../org.apache.stratos.python.cli/src/main/python/cli/Main.py | 3 ++-
.../src/main/python/cli/Stratos.py | 7 +++++--
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/37814177/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
index bc813a4..c4076ba 100644
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
@@ -29,3 +29,4 @@ stratos_url = os.getenv('STRATOS_URL', "https://localhost:9443/")
stratos_api_url = stratos_url + "api/"
stratos_username = os.getenv('STRATOS_USERNAME', "")
stratos_password = os.getenv('STRATOS_PASSWORD', "")
+debug_cli = os.getenv('STRATOS_CLI_DEBUG', "false")
http://git-wip-us.apache.org/repos/asf/stratos/blob/37814177/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
index 27fc283..c4ad036 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
@@ -40,7 +40,8 @@ def prompt_for_credentials():
if Configs.stratos_password is "":
Configs.stratos_password = getpass.getpass("Password: ")
if Stratos.authenticate():
- print("Successfully authenticated")
+ print("Successfully authenticated.")
+ print("Connected to Stratos [%s]" % Configs.stratos_url)
else:
print("Could not authenticate")
exit()
http://git-wip-us.apache.org/repos/asf/stratos/blob/37814177/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
index 2b3dd29..fa30679 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
@@ -467,8 +467,11 @@ class Stratos:
@staticmethod
def response(r):
- # print(r)
- # print(r.text)
+ if Configs.debug_cli:
+ # print responses if debug is turned on
+ print(r)
+ print(r.text)
+
if r.status_code == 200:
return r.json()
elif r.status_code == 201:
[2/3] stratos git commit: Python CLI - Minor fix to debug option
Posted by ch...@apache.org.
Python CLI - Minor fix to debug option
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/afc448c6
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/afc448c6
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/afc448c6
Branch: refs/heads/stratos-4.1.x
Commit: afc448c60e443d2b7e98e488d34729d9b9820d83
Parents: 3781417
Author: Chamila de Alwis <ch...@apache.org>
Authored: Wed Oct 14 00:51:14 2015 +0530
Committer: Chamila de Alwis <ch...@apache.org>
Committed: Wed Oct 14 00:51:14 2015 +0530
----------------------------------------------------------------------
.../org.apache.stratos.python.cli/src/main/python/cli/Configs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/afc448c6/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
index c4076ba..41a04e7 100644
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Configs.py
@@ -29,4 +29,4 @@ stratos_url = os.getenv('STRATOS_URL', "https://localhost:9443/")
stratos_api_url = stratos_url + "api/"
stratos_username = os.getenv('STRATOS_USERNAME', "")
stratos_password = os.getenv('STRATOS_PASSWORD', "")
-debug_cli = os.getenv('STRATOS_CLI_DEBUG', "false")
+debug_cli = os.getenv('STRATOS_CLI_DEBUG', "False")
[3/3] stratos git commit: Python CLI - Minor fix to debug option
Posted by ch...@apache.org.
Python CLI - Minor fix to debug option
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3a6d92d9
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3a6d92d9
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3a6d92d9
Branch: refs/heads/stratos-4.1.x
Commit: 3a6d92d9ee90f1945831d6c5127525ce8cadd255
Parents: afc448c
Author: Chamila de Alwis <ch...@apache.org>
Authored: Wed Oct 14 01:05:36 2015 +0530
Committer: Chamila de Alwis <ch...@apache.org>
Committed: Wed Oct 14 01:05:36 2015 +0530
----------------------------------------------------------------------
.../org.apache.stratos.python.cli/src/main/python/cli/Main.py | 3 +--
.../org.apache.stratos.python.cli/src/main/python/cli/Stratos.py | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/3a6d92d9/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
index c4ad036..2b9b649 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Main.py
@@ -40,8 +40,7 @@ def prompt_for_credentials():
if Configs.stratos_password is "":
Configs.stratos_password = getpass.getpass("Password: ")
if Stratos.authenticate():
- print("Successfully authenticated.")
- print("Connected to Stratos [%s]" % Configs.stratos_url)
+ print("Successfully authenticated [%s]" % Configs.stratos_url)
else:
print("Could not authenticate")
exit()
http://git-wip-us.apache.org/repos/asf/stratos/blob/3a6d92d9/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
index fa30679..ad30186 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
@@ -467,7 +467,7 @@ class Stratos:
@staticmethod
def response(r):
- if Configs.debug_cli:
+ if "False" not in Configs.debug_cli:
# print responses if debug is turned on
print(r)
print(r.text)