Skip to content

Commit

Permalink
Fix bug in metadata2gha options parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
h-haaks committed Apr 25, 2024
1 parent d9dcc12 commit 3738a18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/metadata2gha
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ OptionParser.new do |opts|
end
end
opts.on('--beaker-hosts HOSTNAME:ROLES;HOSTNAME:ROLES;...', 'Expand the setfile string to create multiple hosts with custom roles. Roles string; see beaker-hostgenerator') do |opt|
options[:beaker_hosts] = {}
if opt != 'false'
beaker_hosts = {}
opt.split(';').each do |host|
hostname, roles = host.split(':', 2)
options[:beaker_hosts][hostname] = roles
beaker_hosts[hostname] = roles
end
options[:beaker_hosts] = beaker_hosts if !beaker_hosts.empty?

Check failure on line 51 in bin/metadata2gha

View workflow job for this annotation

GitHub Actions / rubocop

Style/NegatedIf: Favor `unless` over `if` for negative conditions. (https://rubystyle.guide#unless-for-negatives)
end
end
end.parse!
Expand Down

0 comments on commit 3738a18

Please sign in to comment.