@@ -80,6 +80,7 @@ def do_list_users(self, line , opts=None):
80
80
make_option ('-e' , '--email' , type = "str" , help = "Email of the user" ),
81
81
make_option ('-o' , '--profile_name' , type = "str" , help = "Profile name of the user" )
82
82
])
83
+ @auth
83
84
def do_add_user (self , line , opts = None ):
84
85
"""Add a user."""
85
86
try :
@@ -88,8 +89,8 @@ def do_add_user(self, line , opts=None):
88
89
" [-l <last name>] [-o <profile name>]" )
89
90
return
90
91
else :
91
- user = Stratos .add_users (opts .username_user , opts .password_user , opts .role_name , opts .first_name , opts . last_name ,
92
- opts .email , opts .profile_name )
92
+ user = Stratos .add_users (opts .username_user , opts .password_user , opts .role_name , opts .first_name ,
93
+ opts . last_name , opts .email , opts .profile_name )
93
94
if user :
94
95
print ("User successfully created" )
95
96
else :
@@ -100,20 +101,20 @@ def do_add_user(self, line , opts=None):
100
101
@options ([
101
102
make_option ('-u' , '--username' , type = "str" , help = "Username of the user" ),
102
103
make_option ('-p' , '--password' , type = "str" , help = "Password of the user" ),
103
- make_option ('-s' , '--username_user' , type = "str" , help = "Username of the user" ),
104
- make_option ('-a' , '--password_user' , type = "str" , help = "Password of the user" ),
105
- make_option ('-r' , '--role_name' , type = "str" , help = "Role name of the user" ),
106
- make_option ('-f' , '--first_name' , type = "str" , help = "First name of the user" ),
107
- make_option ('-l' , '--last_name' , type = "str" , help = "Last name of the user" ),
108
- make_option ('-e' , '--email' , type = "str" , help = "Email of the user" ),
109
- make_option ('-o' , '--profile_name' , type = "str" , help = "Profile name of the user" )
104
+ make_option ('-s' , '--username_user' , type = "str" , help = "Username of the user to be created " ),
105
+ make_option ('-a' , '--password_user' , type = "str" , help = "Password of the user to be created " ),
106
+ make_option ('-r' , '--role_name' , type = "str" , help = "Role name of the user to be created " ),
107
+ make_option ('-f' , '--first_name' , type = "str" , help = "First name of the user to be created " ),
108
+ make_option ('-l' , '--last_name' , type = "str" , help = "Last name of the user to be created " ),
109
+ make_option ('-e' , '--email' , type = "str" , help = "Email of the user to be created " ),
110
+ make_option ('-o' , '--profile_name' , type = "str" , help = "Profile name of the user to be created " )
110
111
])
111
112
@auth
112
113
def do_update_user (self , line , opts = None ):
113
114
"""Update a specific user."""
114
115
try :
115
- user = Stratos .update_user (opts .username_user , opts .password_user , opts .role_name , opts .first_name , opts . last_name ,
116
- opts .email , opts .profile_name )
116
+ user = Stratos .update_user (opts .username_user , opts .password_user , opts .role_name , opts .first_name ,
117
+ opts .last_name , opts . email , opts .profile_name )
117
118
if user :
118
119
print ("User successfully updated" )
119
120
else :
@@ -133,7 +134,6 @@ def do_remove_user(self, name , opts=None):
133
134
print ("usage: remove-user [username]" )
134
135
else :
135
136
user_removed = Stratos .remove_user (name )
136
- print (user_removed )
137
137
if user_removed :
138
138
print ("You have successfully deleted user: " + name )
139
139
else :
@@ -190,7 +190,7 @@ def do_describe_application(self, application_id , opts=None):
190
190
print ("Application not found in : " + application_id )
191
191
else :
192
192
print ("Application : " + application_id )
193
- PrintableJSON (application ).pprint ()
193
+ PrintableTree (application ).print_tree ()
194
194
except BadResponseError as e :
195
195
self .perror (str (e ))
196
196
@@ -580,7 +580,7 @@ def do_list_cartridges_by_filter(self, filter_text , opts=None):
580
580
"""Retrieve details of available cartridges."""
581
581
try :
582
582
if not filter_text :
583
- print ("" )
583
+ print ("usage: describe-cartridge-by-filter [filter] " )
584
584
else :
585
585
cartridges = Stratos .list_cartridges_by_filter (filter_text )
586
586
table = PrintableTable ()
@@ -1527,4 +1527,4 @@ def do_remove_domain_mappings(self, domain , opts=None):
1527
1527
print ("Could not delete domain: " + domain )
1528
1528
except BadResponseError as e :
1529
1529
self .perror (str (e ))
1530
- logging . error ( "HTTP " + e . error_code + " : " + str ( e ))
1530
+
0 commit comments