Skip to content

Commit fa5d413

Browse files
authored
support_multiple_profiles
Add ENV var for profile name
1 parent 4949183 commit fa5d413

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/softlayer/Config.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def Config.file_settings(*additional_files)
121121
search_path.each do |file_path|
122122
if File.readable? file_path
123123
config = ConfigParser.new file_path
124-
softlayer_section = config['softlayer']
124+
profile_name = ENV['SL_PROFILE'] || 'softlayer'
125+
softlayer_section = config[profile_name]
125126

126127
if softlayer_section
127128
result[:api_key] = softlayer_section['api_key'] if softlayer_section['api_key']

0 commit comments

Comments
 (0)