|
3 | 3 | require_relative 'api/v1' |
4 | 4 | require_relative 'catalog-util/cached_master_directory' |
5 | 5 | require_relative 'cli/diffs' |
6 | | -require_relative 'cli/fact_override' |
7 | 6 | require_relative 'cli/options' |
8 | 7 | require_relative 'cli/printer' |
9 | 8 | require_relative 'errors' |
@@ -82,8 +81,9 @@ def self.cli(argv = ARGV, logger = Logger.new(STDERR), opts = {}) |
82 | 81 | veto_with_none_options = %w(hiera_path hiera_path_strip) |
83 | 82 | veto_with_none_options.each { |x| options.delete(x.to_sym) if options[x.to_sym] == :none } |
84 | 83 |
|
85 | | - # Fact overrides come in here - 'options' is modified |
| 84 | + # Fact and ENC overrides come in here - 'options' is modified |
86 | 85 | setup_fact_overrides(options) |
| 86 | + setup_enc_overrides(options) |
87 | 87 |
|
88 | 88 | # Configure the logger and logger.debug initial information |
89 | 89 | # 'logger' is modified and used |
@@ -136,7 +136,18 @@ def self.setup_fact_overrides(options) |
136 | 136 | next unless o.is_a?(Array) |
137 | 137 | next unless o.any? |
138 | 138 | options[key] ||= [] |
139 | | - options[key].concat o.map { |x| OctocatalogDiff::Cli::FactOverride.fact_override(x) } |
| 139 | + options[key].concat o.map { |x| OctocatalogDiff::API::V1::Override.create_from_input(x) } |
| 140 | + end |
| 141 | + end |
| 142 | + |
| 143 | + # ENC parameter overrides come in here |
| 144 | + def self.setup_enc_overrides(options) |
| 145 | + [:from_enc_override, :to_enc_override].each do |key| |
| 146 | + o = options["#{key}_in".to_sym] |
| 147 | + next unless o.is_a?(Array) |
| 148 | + next unless o.any? |
| 149 | + options[key] ||= [] |
| 150 | + options[key].concat o.map { |x| OctocatalogDiff::API::V1::Override.create_from_input(x) } |
140 | 151 | end |
141 | 152 | end |
142 | 153 |
|
|
0 commit comments