Module: check_mk
Branch: master
Commit: 890ae748f886c58926ef3db5d171f9572e370d92
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=890ae748f886c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 28 10:27:40 2018 +0200
Tiny simplification
Change-Id: I36928a4aeb13d6c9ece48aba5c9d14e48f03a2b1
---
cmk/gui/plugins/userdb/ldap_connector.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/cmk/gui/plugins/userdb/ldap_connector.py
b/cmk/gui/plugins/userdb/ldap_connector.py
index 32f8846..bdf1cdf 100644
--- a/cmk/gui/plugins/userdb/ldap_connector.py
+++ b/cmk/gui/plugins/userdb/ldap_connector.py
@@ -1018,8 +1018,7 @@ class LDAPUserConnector(UserConnector):
user_connection_id =
userdb.cleanup_connection_id(user.get('connector'))
if user_connection_id == connection_id and self._strip_suffix(user_id) not in
ldap_users:
del users[user_id] # remove the user
- if config.wato_enabled:
- changes.append(_("LDAP [%s]: Removed user %s") %
(connection_id, user_id))
+ changes.append(_("LDAP [%s]: Removed user %s") %
(connection_id, user_id))
for user_id, ldap_user in ldap_users.items():
mode_create, user = load_user(user_id)
@@ -1066,7 +1065,7 @@ class LDAPUserConnector(UserConnector):
changed = self._find_changed_user_keys(intersect, users[user_id], user) #
returns a dict
users[user_id] = user # Update the user record
- if mode_create and config.wato_enabled:
+ if mode_create:
changes.append(_("LDAP [%s]: Created user %s") %
(connection_id, user_id))
else:
details = []
@@ -1094,14 +1093,14 @@ class LDAPUserConnector(UserConnector):
for key, (old_value, new_value) in sorted(changed.items()):
details.append(('Changed %s from %s to %s' % (key,
old_value, new_value)))
- if details and config.wato_enabled:
+ if details:
changes.append(_("LDAP [%s]: Modified user %s (%s)") %
(connection_id, user_id, ', '.join(details)))
duration = time.time() - start_time
self._logger.info('SYNC FINISHED - Duration: %0.3f sec', duration)
import cmk.gui.watolib as watolib # TODO: Cleanup
- if changes and not config.is_wato_slave_site():
+ if changes and config.wato_enabled and not config.is_wato_slave_site():
watolib.add_change("edit-users",
"<br>\n".join(changes), add_user=False)
userdb.save_users(users)