From: elijah Date: Thu, 2 Oct 2014 16:07:25 +0000 (-0700) Subject: bugfix: don't overwrite facts if environment is pinned. closes #6169 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=bbda12a4158a445fc7495911b2f5f01e5f139406;p=leap%2Fleap_cli.git bugfix: don't overwrite facts if environment is pinned. closes #6169 --- 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