Skip to content

Commit 17a0f46

Browse files
committed
Validator returns true
1 parent e195af1 commit 17a0f46

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/octocatalog-diff/util/catalogs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def build_catalog(opts, logger = @logger)
234234
def catalog_validator(catalog = nil, _logger = @logger, args = {})
235235
return false unless catalog.is_a?(OctocatalogDiff::Catalog)
236236
catalog.validate_references if args[:task] == :to
237-
return if catalog.valid?
237+
return true if catalog.valid?
238238
raise OctocatalogDiff::Errors::CatalogError, 'Catalog failed: Invalid catalog'
239239
end
240240
end

lib/octocatalog-diff/util/parallel.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,13 @@ def self.execute_task(task, logger)
170170
result = Result.new(output: output, status: true, args: task.args)
171171
rescue => exc
172172
logger.debug("Failed #{task.description}: #{exc.class} #{exc.message}")
173-
result = Result.new(exception: exc, status: false, args: task.args)
173+
return Result.new(exception: exc, status: false, args: task.args)
174174
end
175175

176176
begin
177-
successful_validation = task.validate(output, logger)
178-
if successful_validation
177+
if task.validate(output, logger)
179178
logger.debug("Success #{task.description}")
180179
else
181-
logger.warn("Failed #{task.description} validation")
182180
raise "Failed #{task.description} validation (unspecified error)"
183181
end
184182
rescue => exc

0 commit comments

Comments
 (0)