Skip to content

Commit

Permalink
(PUP-6073) Handle launchd plists with line continuations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ccaviness committed Mar 22, 2016
1 parent eca6be0 commit 26a9881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/provider/service/launchd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 26a9881

Please sign in to comment.