summaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/manager.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-05-27 13:59:02 -0700
committerelijah <elijah@riseup.net>2013-05-27 13:59:02 -0700
commit3a77ab2c9cc82853ef5b0add4f15227cc6d696a9 (patch)
tree2407402e0e238a3e1e2a6349767a6fa2c01857dd /lib/leap_cli/config/manager.rb
parent32e377d905462fa2c20dde9b59532297a7f3aea6 (diff)
added support for disabling nodes
Diffstat (limited to 'lib/leap_cli/config/manager.rb')
-rw-r--r--lib/leap_cli/config/manager.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb
index 0d14541..1f81166 100644
--- a/lib/leap_cli/config/manager.rb
+++ b/lib/leap_cli/config/manager.rb
@@ -17,7 +17,7 @@ module LeapCli
#
# load .json configuration files
#
- def load
+ def load(options = {})
@provider_dir = Path.provider
# load base
@@ -47,6 +47,18 @@ module LeapCli
@nodes[name] = apply_inheritance(node)
end
+ # remove disabled nodes
+ unless options[:include_disabled]
+ @nodes.select! do |name, node|
+ if node.enabled
+ true
+ else
+ log 2, :skipping, "disabled node #{name}."
+ false
+ end
+ end
+ end
+
# validate
validate_provider(@provider)
end