Skip to content

Commit de317d4

Browse files
author
caberos
committed
Remove the -a option from slcli user create
1 parent ff4887e commit de317d4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

SoftLayer/CLI/user/create.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"supersedes this template.")
3030
@click.option('--template', '-t', default=None,
3131
help="A json string describing https://softlayer.github.io/reference/datatypes/SoftLayer_User_Customer/")
32-
@click.option('--api-key', '-a', default=False, is_flag=True, help="Create an API key for this user.")
32+
# @click.option('--api-key', '-a', default=False, is_flag=True, help="Create an API key for this user.")
3333
@environment.pass_env
34-
def cli(env, username, email, password, from_user, template, api_key):
34+
def cli(env, username, email, password, from_user, template):
3535
"""Creates a user Users.
3636
3737
Remember to set the permissions and access for this new user.
@@ -81,13 +81,13 @@ def cli(env, username, email, password, from_user, template, api_key):
8181
raise exceptions.CLIAbort("Canceling creation!")
8282

8383
result = mgr.create_user(user_template, password)
84-
new_api_key = None
85-
if api_key:
86-
click.secho("Adding API key...", fg='green')
87-
new_api_key = mgr.add_api_authentication_key(result['id'])
84+
# new_api_key = None
85+
# if api_key11:
86+
# click.secho("Adding API key...", fg='green')
87+
# new_api_key = mgr.add_api_authentication_key(result['id'])
8888

89-
table = formatting.Table(['Username', 'Email', 'Password', 'API Key'])
90-
table.add_row([result['username'], result['email'], password, new_api_key])
89+
table = formatting.Table(['Username', 'Email', 'Password'])
90+
table.add_row([result['username'], result['email'], password])
9191
env.fout(table)
9292

9393

tests/CLI/modules/user_tests.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ def test_create_user_generate_password_2(self, confirm_mock):
194194
@mock.patch('SoftLayer.CLI.formatting.confirm')
195195
def test_create_user_and_apikey(self, confirm_mock):
196196
confirm_mock.return_value = True
197-
result = self.run_command(['user', 'create', 'test', '-e', '[email protected]', '-a'])
197+
result = self.run_command(['user', 'create', 'test', '-e', '[email protected]'])
198198
self.assert_no_fail(result)
199-
self.assert_called_with('SoftLayer_User_Customer', 'addApiAuthenticationKey')
200199

201200
@mock.patch('SoftLayer.CLI.formatting.confirm')
202201
def test_create_user_with_template(self, confirm_mock):

0 commit comments

Comments
 (0)