aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/object_list.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-06-18 23:59:05 -0700
committerelijah <elijah@riseup.net>2014-06-18 23:59:05 -0700
commit3ddd8e93a161d748e5703b0856cb2eded0dd19c5 (patch)
treec33aa8f80864d7bb0e0d89799ebb7462a77d08c5 /lib/leap_cli/config/object_list.rb
parent755fdd7ad2e5cfc7e8c1e096d4a1939c8801764f (diff)
downloadleap_cli-3ddd8e93a161d748e5703b0856cb2eded0dd19c5.tar.gz
leap_cli-3ddd8e93a161d748e5703b0856cb2eded0dd19c5.tar.bz2
added support for 'control files', files like the .json configuration files but contain arbitrary ruby code evaluated in the context of the node.
Diffstat (limited to 'lib/leap_cli/config/object_list.rb')
-rw-r--r--lib/leap_cli/config/object_list.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/leap_cli/config/object_list.rb b/lib/leap_cli/config/object_list.rb
index e975a5f..cd69d9b 100644
--- a/lib/leap_cli/config/object_list.rb
+++ b/lib/leap_cli/config/object_list.rb
@@ -20,6 +20,8 @@ module LeapCli
# If the key is a hash, we treat it as a condition and filter all the Config::Objects using the condition.
# A new ObjectList is returned.
#
+ # If the key is an array, it is treated as an array of node names
+ #
# Examples:
#
# nodes['vpn1']
@@ -64,6 +66,11 @@ module LeapCli
end
end
results
+ elsif key.is_a? Array
+ key.inject(Config::ObjectList.new) do |list, node_name|
+ list[node_name] = super(node_name.to_s)
+ list
+ end
else
super key.to_s
end