From 26a988120cc87c55e301f1e07e055cb01ea4c0ea Mon Sep 17 00:00:00 2001 From: Clay Caviness Date: Tue, 22 Mar 2016 14:41:26 -0400 Subject: [PATCH] (PUP-6073) Handle launchd plists with line continuations Even though line continuations in text plist files is valid XML, the plist parser in facter 2.x can't handle it. In this case, rescue `NoMethodError' and let `plutil -convert xml1' normalize it. --- lib/puppet/provider/service/launchd.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb index a7eb3a37369..a82f9f43f20 100644 --- a/lib/puppet/provider/service/launchd.rb +++ b/lib/puppet/provider/service/launchd.rb @@ -206,7 +206,7 @@ def has_macosx_plist_overrides? def self.read_plist(path) begin return Plist::parse_xml(path) - rescue ArgumentError => detail + rescue ArgumentError, NoMethodError => detail Puppet.debug("Error reading #{path}: #{detail}. Retrying with plutil.") end