Skip to content

Commit 7850af6

Browse files
authored
Merge pull request #52 from puppetlabs/CAT-1307-add_bolt_project_support
(CAT-1307) - Fix broken CAT default module dependency check
2 parents 18d961b + 23ee29f commit 7850af6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

bin/dependency-checker

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ if options[:namespace]
8686
runner.resolve_from_namespace(options[:namespace], options[:endorsement])
8787

8888
elsif ARGV.empty?
89-
puts "No module criteria specified. Defaulting to IAC supported modules.\n\n"
90-
runner.resolve_from_path('https://puppetlabs.github.io/iac/modules.json')
89+
puts "No module criteria specified. Defaulting to CAT supported modules.\n\n"
90+
runner.resolve_from_path('https://puppetlabs.github.io/content-and-tooling-team/modules/list.json')
9191

9292
elsif ARGV.map { |arg| File.basename arg } != ['metadata.json']
9393
runner.resolve_from_path(ARGV.first)

lib/dependency_checker/runner.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Main runner for DependencyChecker
1010
module DependencyChecker
11-
class Runner
11+
class Runner # rubocop:disable Metrics/ClassLength
1212
attr_reader :problems
1313

1414
def initialize(verbose = false, forge_hostname = nil, forge_token = nil)
@@ -184,10 +184,12 @@ def return_modules(path)
184184
raise "*Error:* Ensure syntax of #{path} file is valid YAML or JSON"
185185
end
186186

187-
# transform from IAC supported module hash to simple list
188-
modules = modules.filter_map { |_key, val| val['puppet_module'] } if modules.is_a? Hash
189-
190-
modules
187+
# transform from CAT supported module hash to simple list
188+
if path.end_with? '/content-and-tooling-team/modules/list.json'
189+
modules.filter_map { |key, _val| key['name'] } if modules.is_a? Array
190+
elsif modules.is_a? Hash
191+
modules.filter_map { |_key, val| val['puppet_module'] }
192+
end
191193
end
192194

193195
# Post message to terminal

0 commit comments

Comments
 (0)