Sha256: 40bf28b9ee61acf1a6fe1e3fb024aa13935c40c64474d519320136c89db9e08b
Contents?: true
Size: 844 Bytes
Versions: 158
Compression:
Stored size: 844 Bytes
Contents
# various user-configurable mappings defined in /etc/katello/mapping.yml require 'yaml' module Katello module Mapping def self.configuration return @config if @config mapping_file = '/etc/katello/mapping.yml' if File.readable?(mapping_file) @config = YAML.load_file(mapping_file) else @config = {} end end class ImageFactoryNaming def self.translate(name = '', version = '') matched_name = "#{name} #{version}" naming = Mapping.configuration['imagefactory_naming'] || {} naming.each do |key, values| regexp_str = "^#{Regexp.escape(key).gsub('\*', '.*')}$" if Regexp.new(regexp_str) =~ matched_name return values.map(&:to_s) end end return [name.to_s, version.to_s] end end end end
Version data entries
158 entries across 158 versions & 1 rubygems