Server IP : 111.118.215.189 / Your IP : 3.145.60.193 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/ruby/vendor_ruby/puppet/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
# Manage a collection of confines, returning a boolean or # helpful information. require 'puppet/confine' class Puppet::ConfineCollection def confine(hash) if hash.include?(:for_binary) for_binary = true hash.delete(:for_binary) else for_binary = false end hash.each do |test, values| if klass = Puppet::Confine.test(test) @confines << klass.new(values) @confines[-1].for_binary = true if for_binary else confine = Puppet::Confine.test(:variable).new(values) confine.name = test @confines << confine end @confines[-1].label = self.label end end attr_reader :label def initialize(label) @label = label @confines = [] end # Return a hash of the whole confine set, used for the Provider # reference. def summary confines = Hash.new { |hash, key| hash[key] = [] } @confines.each { |confine| confines[confine.class] << confine } result = {} confines.each do |klass, list| value = klass.summarize(list) next if (value.respond_to?(:length) and value.length == 0) or (value == 0) result[klass.name] = value end result end def valid? ! @confines.detect { |c| ! c.valid? } end end