From bbda12a4158a445fc7495911b2f5f01e5f139406 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 2 Oct 2014 09:07:25 -0700 Subject: bugfix: don't overwrite facts if environment is pinned. closes #6169 --- lib/leap_cli/commands/facts.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3