summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob <bvandenheuvel@schubergphilis.com>2014-10-14 13:27:52 +0200
committerJay Mundrawala <jdmundrawala@gmail.com>2014-10-22 12:20:13 -0700
commit289aefe1049185257f0b7f0024872aa79d79d0b2 (patch)
tree4623655f653e34421aa028a058147e20317a8fa1
parented164c6386c89c5fbe2918ebda06028332724034 (diff)
downloadchef-289aefe1049185257f0b7f0024872aa79d79d0b2.tar.gz
Improve detection missing WhatIf support
From output of Whatif-run, do not replace line break by space, as this breaks the match if the break was done within a word.
-rw-r--r--lib/chef/util/dsc/local_configuration_manager.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb
index 4d49c8dcff..b55d0c364a 100644
--- a/lib/chef/util/dsc/local_configuration_manager.rb
+++ b/lib/chef/util/dsc/local_configuration_manager.rb
@@ -79,7 +79,7 @@ EOH
end
def log_what_if_exception(what_if_exception_output)
- if what_if_exception_output.gsub(/\s+/, ' ') =~ /A parameter cannot be found that matches parameter name 'Whatif'/i
+ if what_if_exception_output.gsub(/[\r\n]+/, '').gsub(/\s+/, ' ') =~ /A parameter cannot be found that matches parameter name 'Whatif'/i
# LCM returns an error if any of the resources do not support the opptional What-If
Chef::Log::warn("Received error while testing configuration due to resource not supporting 'WhatIf'")
elsif dsc_module_import_failure?(what_if_exception_output)