diff --git a/lib/zanzibar/actions/bundle.rb b/lib/zanzibar/actions/bundle.rb index aa27a86..816cdcd 100644 --- a/lib/zanzibar/actions/bundle.rb +++ b/lib/zanzibar/actions/bundle.rb @@ -95,11 +95,8 @@ module Zanzibar downloaded_secrets = {} remote_secrets.each do |key, secret| full_path = secret.key?('prefix') ? File.join(@settings['secret_dir'], secret['prefix']) : @settings['secret_dir'] - downloaded_secrets[key] = download_one_secret(secret['id'], - secret['label'], - full_path, - args, - secret['name'] || "#{secret['id']}_password") + downloaded_secrets[key] = download_one_secret(secret['id'], secret['label'], full_path, + args, secret_filename(secret)) debug { "Downloaded secret: #{key} to #{@settings['secret_dir']}..." } end @@ -134,6 +131,10 @@ module Zanzibar domain: @settings['domain'], globals: args) end + + def secret_filename(secret) + secret['name'] || "#{secret['id']}_password" + end end end end