Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/facter/custom_facts/util/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def create_or_return_fact(name, options)
if fact.nil?
fact = Facter::Util::Fact.new(name, options)
@facts[name] = fact
else
fact.extract_ldapname_option!(options)
end

fact
Expand Down
17 changes: 0 additions & 17 deletions lib/facter/custom_facts/util/fact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class Fact
# @return [String]
attr_reader :name

# @return [String]
# @deprecated
attr_accessor :ldapname

# Fact options e.g. fact_type
attr_accessor :options

Expand All @@ -31,16 +27,12 @@ class Fact
# for the public API for creating facts.
# @param name [String] the fact name
# @param options [Hash] optional parameters
# @option options [String] :ldapname set the ldapname property on the fact
#
# @api private
def initialize(name, options = {})
@name = LegacyFacter::Util::Normalization.normalize(name.to_s.downcase).intern

@options = options.dup
extract_ldapname_option!(options)

@ldapname ||= @name.to_s

@resolves = []
@searching = false
Expand Down Expand Up @@ -142,15 +134,6 @@ def value
@value
end

# @api private
# @deprecated
def extract_ldapname_option!(options)
return unless options[:ldapname]

log.warnonce('ldapname is deprecated and will be removed in a future version')
self.ldapname = options.delete(:ldapname)
end

private

def log
Expand Down
6 changes: 0 additions & 6 deletions spec/custom_facts/util/collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ def load(collection)
expect(collection.define_fact(:newfact)).to equal fact
end

it 'passes options to newly generated facts' do
allow(logger).to receive(:warnonce)
fact = collection.define_fact(:newfact, ldapname: 'NewFact')
expect(fact.ldapname).to eq 'NewFact'
end

it 'logs an error if the fact name contains the utf-8 null byte' do
name = "Uncool\0Name"
normalization_error = LegacyFacter::Util::Normalization::NormalizationError
Expand Down
5 changes: 0 additions & 5 deletions spec/custom_facts/util/fact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
expect(Facter::Util::Fact.new('YayNess').name).to eq :yayness
end

it 'issues a deprecation warning for use of ldapname' do
expect(logger).to receive(:warnonce).with('ldapname is deprecated and will be removed in a future version')
Facter::Util::Fact.new('YayNess', ldapname: 'fooness')
end

describe 'when adding resolution mechanisms using #add' do
it 'delegates to #define_resolution with an anonymous resolution' do
expect(fact).to receive(:define_resolution).with(nil, {})
Expand Down
Loading