aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-12-17 22:17:29 -0800
committerelijah <elijah@riseup.net>2012-12-17 22:17:29 -0800
commitea4c51b822691ad59ab04fd9b12cc408fd105f1b (patch)
tree6575504049fb25672f9d7f42141ea7d0b89833b7
parent1e6e6b94e80bf085b139c6706754f66ab1356a55 (diff)
downloadleap_cli-ea4c51b822691ad59ab04fd9b12cc408fd105f1b.tar.gz
leap_cli-ea4c51b822691ad59ab04fd9b12cc408fd105f1b.tar.bz2
forbid illegal characters in the node name.
-rw-r--r--lib/leap_cli/commands/node.rb2
-rw-r--r--lib/leap_cli/config/manager.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/node.rb b/lib/leap_cli/commands/node.rb
index 87718e9..6a60c45 100644
--- a/lib/leap_cli/commands/node.rb
+++ b/lib/leap_cli/commands/node.rb
@@ -22,7 +22,7 @@ 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}'"
+ assert! name =~ /^[0-9a-z-]+$/, "illegal characters used in node name '#{name}'"
assert_files_missing! [:node_config, node.name]
# create and seed new node
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb
index adda9bd..6702fc4 100644
--- a/lib/leap_cli/config/manager.rb
+++ b/lib/leap_cli/config/manager.rb
@@ -43,6 +43,7 @@ module LeapCli
@common.inherit_from! base_common
@provider.inherit_from! base_provider
@nodes.each do |name, node|
+ Util::assert! name =~ /^[0-9a-z-]+$/, "Illegal character(s) used in node name '#{name}'"
@nodes[name] = apply_inheritance(node)
end