From 11a058fa3937fc94bf788afdb9b6d607ac2923e4 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Mon, 4 Mar 2019 08:56:18 -0800 Subject: [PATCH] Bug fix for na_elementsw_admin_users (#52377) * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "Revert "changes to clusteR"" This reverts commit f1104a37b42886aebb4d2b2ab27c91c96d97858a. * Updates * bug fix * Bug fix * Revert "Bug fix" This reverts commit 5cbea70a6587b7bc5e8a4da912549fbc63ff6235. --- .../storage/netapp/na_elementsw_admin_users.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_elementsw_admin_users.py b/lib/ansible/modules/storage/netapp/na_elementsw_admin_users.py index c1744546334..a0e05c83a2f 100644 --- a/lib/ansible/modules/storage/netapp/na_elementsw_admin_users.py +++ b/lib/ansible/modules/storage/netapp/na_elementsw_admin_users.py @@ -163,20 +163,22 @@ class NetAppElementSWAdminUser(object): def modify_admin_user(self): """ - Modify a admin user. If a password is set the user will be modified as there is no way to compare a new password with an existing one + Modify a admin user. If a password is set the user will be modified as there is no way to + compare a new password with an existing one :return: if a user was modified or not """ changed = False admin_user = self.get_admin_user() - if not admin_user.access == self.access and self.access is not None: - changed = True - if self.element_password: - changed = True + if self.access is not None and len(self.access) > 0: + for access in self.access: + if access not in admin_user.access: + changed = True if changed: self.sfe.modify_cluster_admin(cluster_admin_id=admin_user.cluster_admin_id, access=self.access, password=self.element_password, attributes=self.attributes) + return changed def add_admin_user(self):