From c6fb3370e21f6ab05af62f3eb016ebe03ae6dea7 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Mon, 18 Jan 2021 16:30:49 +0100 Subject: [PATCH] Fixes #3373 - LDAP users marked as inactive. --- .../unit/import/common/model/skip/missing_mandatory/base.rb | 6 +++--- spec/lib/sequencer/sequence/import/ldap/users_spec.rb | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/sequencer/unit/import/common/model/skip/missing_mandatory/base.rb b/lib/sequencer/unit/import/common/model/skip/missing_mandatory/base.rb index a3f53f703..e93a03985 100644 --- a/lib/sequencer/unit/import/common/model/skip/missing_mandatory/base.rb +++ b/lib/sequencer/unit/import/common/model/skip/missing_mandatory/base.rb @@ -18,7 +18,7 @@ class Sequencer provides :action def process - return if !skip? + return if !mandatory_missing? logger.info { skip_log_message } state.provide(:action, :skipped) @@ -30,10 +30,10 @@ class Sequencer raise "Missing implementation of '#{__method__}' method for '#{self.class.name}'" end - def skip? + def mandatory_missing? return true if attribute_value.blank? - missing_for_keys.blank? + missing_for_keys.present? end def skip_log_message diff --git a/spec/lib/sequencer/sequence/import/ldap/users_spec.rb b/spec/lib/sequencer/sequence/import/ldap/users_spec.rb index cf6e8c048..25dd4dbb7 100644 --- a/spec/lib/sequencer/sequence/import/ldap/users_spec.rb +++ b/spec/lib/sequencer/sequence/import/ldap/users_spec.rb @@ -23,7 +23,8 @@ RSpec.describe ::Sequencer::Sequence::Import::Ldap::Users, sequencer: :sequence group_entry.dn => [1, 2] }, user_attributes: { - 'first_name' => 'firstname', + 'samaccountname' => 'login', + 'first_name' => 'firstname', }, user_uid: 'objectguid', unassigned_users: 'skip_sync', @@ -107,7 +108,8 @@ RSpec.describe ::Sequencer::Sequence::Import::Ldap::Users, sequencer: :sequence group_entry.dn => agent_admin_role_ids }, user_attributes: { - 'first_name' => 'firstname', + 'samaccountname' => 'login', + 'first_name' => 'firstname', }, user_uid: 'objectguid', }