summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-07-05 02:31:04 -0700
committerelijah <elijah@riseup.net>2016-07-05 02:31:04 -0700
commit4ca478b5edd0fd82ea445936508db6ec33fe082d (patch)
tree491beed7958e747a923a56add557ed41b632f049
parent72cf643ad03bf247784b686c1fabb1ba73ddc572 (diff)
prevent users from configuring a node and an environment with the same name
-rw-r--r--lib/leap_cli/config/manager.rb5
-rw-r--r--tests/puppet/provider/tags/single.json4
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb
index aea1d322..62eaa894 100644
--- a/lib/leap_cli/config/manager.rb
+++ b/lib/leap_cli/config/manager.rb
@@ -387,6 +387,11 @@ module LeapCli
env('_all_').tags[node_tag].node_list.add(node.name, node)
end
end
+ if node.name == 'default' || environment_names.include?(node.name)
+ LeapCli::Util.bail! do
+ LeapCli.log :error, "The node name '#{node.name}' is invalid, because there is an environment with that same name."
+ end
+ end
elsif !options[:include_disabled]
LeapCli.log 2, :skipping, "disabled node #{name}."
env.nodes.delete(name)
diff --git a/tests/puppet/provider/tags/single.json b/tests/puppet/provider/tags/single.json
deleted file mode 100644
index d856c6ee..00000000
--- a/tests/puppet/provider/tags/single.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "environment": "single"
-
-}