gitlab_user: Fix ssh key add and group membership add when there's other changes (#63621) (#63634)

* Fixed syntax in sshkey/group add

* Added changelog

* pep8 fix

(cherry picked from commit b4bb3dee9a)
This commit is contained in:
Andrea Tartaglia 2019-11-12 21:01:53 +00:00 committed by Matt Davis
parent 20735f6b5b
commit 50bbd72694
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "gitlab_user - Fix adding ssh key to new/changed user and adding group membership for new/changed user"

View file

@ -233,13 +233,15 @@ class GitLabUser(object):
# Assign ssh keys
if options['sshkey_name'] and options['sshkey_file']:
changed = changed or self.addSshKeyToUser(user, {
key_changed = self.addSshKeyToUser(user, {
'name': options['sshkey_name'],
'file': options['sshkey_file']})
changed = changed or key_changed
# Assign group
if options['group_path']:
changed = changed or self.assignUserToGroup(user, options['group_path'], options['access_level'])
group_changed = self.assignUserToGroup(user, options['group_path'], options['access_level'])
changed = changed or group_changed
self.userObject = user
if changed: