summaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/manager.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-05-27 15:07:32 -0700
committerelijah <elijah@riseup.net>2013-05-27 15:07:32 -0700
commit41f5d1da28054f5bd208c8825fc552f038b764c8 (patch)
tree0a23a626b66354295b65a1dd249b04f23bc2935c /lib/leap_cli/config/manager.rb
parent3a77ab2c9cc82853ef5b0add4f15227cc6d696a9 (diff)
prevent `leap compile` from destroying disabled node files.
Diffstat (limited to 'lib/leap_cli/config/manager.rb')
-rw-r--r--lib/leap_cli/config/manager.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb
index 1f81166..dc74b6c 100644
--- a/lib/leap_cli/config/manager.rb
+++ b/lib/leap_cli/config/manager.rb
@@ -48,12 +48,14 @@ module LeapCli
end
# remove disabled nodes
+ @disabled_nodes = Config::ObjectList.new
unless options[:include_disabled]
@nodes.select! do |name, node|
if node.enabled
true
else
log 2, :skipping, "disabled node #{name}."
+ @disabled_nodes[name] = node
false
end
end
@@ -89,6 +91,14 @@ module LeapCli
updated_hiera << hierapath
end
+ if @disabled_nodes
+ # make disabled nodes appear as if they are still active
+ @disabled_nodes.each_node do |node|
+ updated_files << Path.named_path([:node_files_dir, node.name], @provider_dir)
+ updated_hiera << Path.named_path([:hiera, node.name], @provider_dir)
+ end
+ end
+
# remove files that are no longer needed
if existing_hiera
(existing_hiera - updated_hiera).each do |filepath|