aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-03-24 10:26:49 -0700
committerelijah <elijah@riseup.net>2014-03-24 10:26:49 -0700
commit2b6f4b85a3089eacb19f7b6c165419c6620aeb45 (patch)
tree69edf7b5c0c2959bd4f591b536ec044865726f81
parent7272dfa3c6d4c3c8877eea2a66fe84c7904cafa5 (diff)
downloadleap_cli-2b6f4b85a3089eacb19f7b6c165419c6620aeb45.tar.gz
leap_cli-2b6f4b85a3089eacb19f7b6c165419c6620aeb45.tar.bz2
prevent invalid vangrant node names
-rw-r--r--lib/leap_cli/commands/node.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/node.rb b/lib/leap_cli/commands/node.rb
index b554c1f..a4c0d1a 100644
--- a/lib/leap_cli/commands/node.rb
+++ b/lib/leap_cli/commands/node.rb
@@ -23,7 +23,11 @@ module LeapCli; module Commands
# argument sanity checks
name = args.first
assert! name, 'No <node-name> specified.'
- assert! name =~ /^[0-9a-z-]+$/, "illegal characters used in node name '#{name}'"
+ if options[:local]
+ assert! name =~ /^[0-9a-z]+$/, "illegal characters used in node name '#{name}' (note: Vagrant does not allow hyphens or underscores)"
+ else
+ assert! name =~ /^[0-9a-z-]+$/, "illegal characters used in node name '#{name}' (note: Linux does not allow underscores)"
+ end
assert_files_missing! [:node_config, name]
# create and seed new node