]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
bugfix: don't overwrite facts if environment is pinned. closes #6169
authorelijah <elijah@riseup.net>
Thu, 2 Oct 2014 16:07:25 +0000 (09:07 -0700)
committerelijah <elijah@riseup.net>
Thu, 2 Oct 2014 16:07:25 +0000 (09:07 -0700)
lib/leap_cli/commands/facts.rb

index d607086de6d94d96b3b646b86c4698d4e5167487..65eda6175b708aab340d78bc75787fb2d796f842 100644 (file)
@@ -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