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/10/13 13:07:00 UTC

[37/50] stratos git commit: Updated user related commands

Updated user related commands

Signed-off-by: Imesh Gunaratne <im...@apache.org>


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

Branch: refs/heads/stratos-4.1.x
Commit: f5e61ea9935aaa008103e06c20739a4713eee370
Parents: 822454e
Author: Milindu Sanoj Kumarage <ag...@gmail.com>
Authored: Thu Aug 6 10:16:57 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Tue Oct 13 16:32:48 2015 +0530

----------------------------------------------------------------------
 .../src/main/python/cli/CLI.py                  | 45 ++++++++++----------
 1 file changed, 23 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f5e61ea9/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py b/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
index 83374c7..b91ba4b 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/CLI.py
@@ -66,12 +66,34 @@ class CLI(Cmd):
         table.print_table()
 
     """
-    # User Entity
+    User
+     * list-users
+     * add-user
 
     """
 
     @options([
         make_option('-u', '--username', type="str", help="Username of the user"),
+        make_option('-p', '--password', type="str", help="Password of the user")
+    ])
+    @auth
+    def do_list_users(self, line , opts=None):
+        """Illustrate the base class method use."""
+        try:
+            users = Stratos.list_users()
+            table = PrintableTable()
+            rows = [["Name", "language"]]
+            table.set_cols_align(["l", "r"])
+            table.set_cols_valign(["t", "m"])
+            for user in users:
+                rows.append([user['role'], user['userName']])
+            table.add_rows(rows)
+            table.print_table()
+        except AuthenticationError as e:
+            self.perror("Authentication Error")
+
+    @options([
+        make_option('-u', '--username', type="str", help="Username of the user"),
         make_option('-p', '--password', type="str", help="Password of the user"),
         make_option('-r', '--role_name', type="str", help="Role name of the user"),
         make_option('-f', '--first_name', type="str", help="First name of the user"),
@@ -97,27 +119,6 @@ class CLI(Cmd):
         make_option('-p', '--password', type="str", help="Password of the user")
     ])
     @auth
-    def do_list_users(self, line , opts=None):
-        """Illustrate the base class method use."""
-        try:
-            users = Stratos.list_users()
-            table = PrintableTable()
-            rows = [["Name", "language"]]
-            table.set_cols_align(["l", "r"])
-            table.set_cols_valign(["t", "m"])
-            for user in users:
-                rows.append([user['role'], user['userName']])
-            table.add_rows(rows)
-            table.print_table()
-        except AuthenticationError as e:
-            self.perror("Authentication Error")
-
-
-    @options([
-        make_option('-u', '--username', type="str", help="Username of the user"),
-        make_option('-p', '--password', type="str", help="Password of the user")
-    ])
-    @auth
     def do_list_network_partitions(self, line , opts=None):
         """Illustrate the base class method use."""
         network_partitions = Stratos.list_network_partitions()