diff options
author | varac <varacanero@zeromail.org> | 2017-05-03 10:02:39 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2017-05-03 10:02:39 +0200 |
commit | b7c764341a1d3b112707a90fe6c15a6033605699 (patch) | |
tree | 706bae570864c7cffb597b40a615fe833c0ad72e /lib/leap_cli/config | |
parent | 4d32af7f7b7bb1d7d30e0306d84015f65c66cf13 (diff) | |
parent | 0b3aef03cb113e997c2a654ef2f7b1674a0a8877 (diff) |
Merge remote-tracking branch 'origin/merge-requests/80'
Diffstat (limited to 'lib/leap_cli/config')
-rw-r--r-- | lib/leap_cli/config/manager.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb index d69a5808..a9f1a85f 100644 --- a/lib/leap_cli/config/manager.rb +++ b/lib/leap_cli/config/manager.rb @@ -342,14 +342,25 @@ module LeapCli if node.vagrant? return self.env("local") else - environment = self.env(default_environment) + environment = nil if node['tags'] node['tags'].to_a.each do |tag| if self.environment_names.include?(tag) - environment = self.env(tag) + if environment.nil? + environment = self.env(tag) + else + LeapCli::Util.bail! do + LeapCli.log( + :error, + "The node '%s' is invalid, because it cannot have two environments ('%s' and '%s')." % + [node.name, environment.name, tag] + ) + end + end end end end + environment ||= self.env(default_environment) return environment end end |