summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-10-02 09:07:25 -0700
committerelijah <elijah@riseup.net>2014-10-02 09:07:25 -0700
commitbbda12a4158a445fc7495911b2f5f01e5f139406 (patch)
treec79bdb224959e316ce963fa50c8cc314006aaf48
parenta5503a1bdd7668cbd6ee5bd191f9c82d65184030 (diff)
bugfix: don't overwrite facts if environment is pinned. closes #6169
-rw-r--r--lib/leap_cli/commands/facts.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/facts.rb b/lib/leap_cli/commands/facts.rb
index d607086..65eda61 100644
--- a/lib/leap_cli/commands/facts.rb
+++ b/lib/leap_cli/commands/facts.rb
@@ -91,7 +91,9 @@ module LeapCli; module Commands
end
end
end
- overwrite_existing = args.empty?
+ # only overwrite the entire facts file if and only if we are gathering facts
+ # for all nodes in all environments.
+ overwrite_existing = args.empty? && LeapCli.leapfile.environment.nil?
update_facts_file(new_facts, overwrite_existing)
end