File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,12 @@ def retries
202
202
nil
203
203
end
204
204
205
+ # By default, catalogs do not support converting and comparing file resources. This can be overridden
206
+ # by backends that do support it.
207
+ def supports_compare_file_text?
208
+ false
209
+ end
210
+
205
211
# Determine if the catalog build was successful.
206
212
# @return [Boolean] Whether the catalog is valid
207
213
def valid?
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ def convert_file_resources(logger = Logger.new(StringIO.new))
71
71
convert_file_resources_real ( logger )
72
72
end
73
73
74
+ def supports_compare_file_text?
75
+ true
76
+ end
77
+
74
78
private
75
79
76
80
# Private method: Clean up a checkout directory, if it exists
@@ -124,7 +128,7 @@ def bootstrap(logger)
124
128
125
129
# Private method: Build catalog by running Puppet
126
130
# @param logger [Logger] Logger object
127
- def build_catalog ( logger = nil )
131
+ def build_catalog ( logger )
128
132
if @facts_terminus != 'facter'
129
133
facts_obj = OctocatalogDiff ::CatalogUtil ::Facts . new ( @opts , logger )
130
134
logger . debug "Start retrieving facts for #{ @node } from #{ self . class } "
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ def initialize(options)
33
33
def convert_file_resources ( logger = Logger . new ( StringIO . new ) )
34
34
convert_file_resources_real ( logger )
35
35
end
36
+
37
+ def supports_compare_file_text?
38
+ true
39
+ end
36
40
end
37
41
end
38
42
end
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def build_catalog_parallelizer
70
70
# Disable --compare-file-text if either (or both) of the chosen backends do not support it
71
71
if @options . fetch ( :compare_file_text , false )
72
72
result . each do |_key , val |
73
- next unless val . convert_file_resources == false
73
+ next if val . supports_compare_file_text?
74
74
@logger . debug "Disabling --compare-file-text; not supported by #{ val . builder } "
75
75
@options [ :compare_file_text ] = false
76
76
catalog_tasks . map! do |x |
You can’t perform that action at this time.
0 commit comments