diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 6 | ||||
-rw-r--r-- | lib/puppet/provider/package/pkgdmg.rb | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index d4b7449fb..27192af17 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -25,7 +25,11 @@ class Puppet::Parser::Interpreter # evaluate our whole tree def compile(node) raise Puppet::ParseError, "Could not parse configuration; cannot compile" unless env_parser = parser(node.environment) - return Puppet::Parser::Compiler.new(node, env_parser).compile + begin + return Puppet::Parser::Compiler.new(node, env_parser).compile + rescue + raise Puppet::Error, "Could not compile node %s" % node + end end # create our interpreter diff --git a/lib/puppet/provider/package/pkgdmg.rb b/lib/puppet/provider/package/pkgdmg.rb index 2020b6b56..2614d0950 100644 --- a/lib/puppet/provider/package/pkgdmg.rb +++ b/lib/puppet/provider/package/pkgdmg.rb @@ -145,11 +145,8 @@ file system and not via a URL method." begin open(cached_source) do |dmg| xml_str = hdiutil "mount", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", "/tmp", dmg.path - ptable = Plist::parse_xml xml_str - # JJM Filter out all mount-paths into a single array, discard the rest. - mounts = ptable['system-entities'].collect { |entity| - entity['mount-point'] - }.select { |mountloc|; mountloc } + # JJM THIS IS A HORRIBLE HACK (Well, actually it's not so bad...) + mounts = xml_str.scan(/<string>(\/tmp.*?)<\/string>/)[0] begin mounts.each do |fspath| Dir.entries(fspath).select { |f| |