From 2b6f4b85a3089eacb19f7b6c165419c6620aeb45 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 24 Mar 2014 10:26:49 -0700 Subject: prevent invalid vangrant node names --- lib/leap_cli/commands/node.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 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 -- cgit v1.2.3