summaryrefslogtreecommitdiffstats
path: root/lib/facter/util/resolution.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facter/util/resolution.rb')
-rw-r--r--lib/facter/util/resolution.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/facter/util/resolution.rb b/lib/facter/util/resolution.rb
index 4a99c35..2ca2447 100644
--- a/lib/facter/util/resolution.rb
+++ b/lib/facter/util/resolution.rb
@@ -85,17 +85,29 @@ class Facter::Util::Resolution
end
end
+ # Say this resolution came from the environment
+ def from_environment
+ @from_environment = true
+ end
+
# Create a new resolution mechanism.
def initialize(name)
@name = name
@confines = []
@value = nil
@timeout = 0
+ @from_environment = false
end
# Return the number of confines.
def length
- @confines.length
+ # If the resolution came from an environment variable
+ # say we're very very sure about the value of the resolution
+ if @from_environment
+ 1_000_000_000
+ else
+ @confines.length
+ end
end
# We need this as a getter for 'timeout', because some versions