cli: fix typo in edit-user cmd

fixes: #862
This commit is contained in:
Yu Ming Zhu 2019-10-22 10:43:44 +00:00
parent 87685df50e
commit f66bb81a85
2 changed files with 2 additions and 2 deletions

View file

@ -2083,7 +2083,7 @@ def handle_edit_user(goptions, session, args):
princ_mappings = []
for p in options.edit_krb:
old, new = p.split('=', 1)
princ_mappings.append({'old': arg_filter(old), 'new': arg_filter(old)})
princ_mappings.append({'old': arg_filter(old), 'new': arg_filter(new)})
for a in options.add_krb:
princ_mappings.append({'old': None, 'new': arg_filter(a)})
for r in options.remove_krb:

View file

@ -43,7 +43,7 @@ class TestEditUser(unittest.TestCase):
# Finally, assert that things were called as we expected.
activate_session_mock.assert_called_once_with(session, options)
session.editUser.assert_called_once_with(user, rename,
[{'new': 'oldkrb', 'old': 'oldkrb'},
[{'new': 'newkrb', 'old': 'oldkrb'},
{'new': 'addedkrb', 'old': None},
{'new': None, 'old': 'removedkrb'}])
self.assertEqual(rv, None)