vendored/puppet/lib/puppet/settings/environment_conf.rb in bolt-0.20.3 vs vendored/puppet/lib/puppet/settings/environment_conf.rb in bolt-0.20.5

- old
+ new

@@ -99,11 +99,11 @@ default_modulepath = [File.join(@path_to_env, "modules")] + @global_module_path get_setting(:modulepath, default_modulepath) do |modulepath| path = modulepath.kind_of?(String) ? modulepath.split(File::PATH_SEPARATOR) : modulepath - path.map { |p| absolute(p) }.join(File::PATH_SEPARATOR) + path.map { |p| expand_glob(absolute(p)) }.flatten.join(File::PATH_SEPARATOR) end end def rich_data get_setting(:rich_data, Puppet.settings.value(:rich_data)) do |value| @@ -162,9 +162,18 @@ def get_setting(setting_name, default = nil) value = raw_setting(setting_name) value = default if value.nil? yield value + end + + def expand_glob(path) + return nil if path.nil? + if path =~ /[*?\[\{]/ + Dir.glob(path) + else + path + end end def absolute(path) return nil if path.nil? if path =~ /^\$/