Skip to content

Commit

Permalink
fix: testing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Simen Andrè Vikestrand Skogum committed Oct 16, 2024
1 parent ff8c6c8 commit e4723c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libraries/ldap_config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def load_file_ldap_config_host_attributes(config_file, host)
# @param group_dn [String] The group DN to return configuration for
# @return [Hash] Host attribute configuration
#
def load_file_ldap_config_host_group_mapping(config_file, host, group_dn)
def load_file_ldap_config_host_group_mapping(config_file, host, org_role)
host_config = load_file_ldap_config_host(config_file, host)

return if nil_or_empty?(host_config)

group_mapping = host_config.fetch('group_mappings', []).select { |gm| gm['group_dn'].eql?(group_dn) }.first
group_mapping = host_config.fetch('group_mappings', []).select { |gm| gm['org_role'].eql?(org_role) }.first
Chef::Log.debug("load_file_ldap_config_host_group_mapping: #{config_file} host #{host} group #{group_dn} - [#{group_mapping.class}] #{group_mapping}")

group_mapping
Expand Down
2 changes: 1 addition & 1 deletion resources/config_ldap_group_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
property :org_id, Integer

load_current_value do |new_resource|
current_config = load_file_ldap_config_host_group_mapping(new_resource.config_file, new_resource.host, new_resource.group_dn)
current_config = load_file_ldap_config_host_group_mapping(new_resource.config_file, new_resource.host, new_resource.org_role)

current_value_does_not_exist! unless current_config

Expand Down

0 comments on commit e4723c8

Please sign in to comment.