Pass on only the exception message for puppet 6 compatibility

This commit is contained in:
2018-10-14 11:34:51 +01:00
parent e5718d058e
commit 1c7804128c

View File

@@ -48,7 +48,7 @@ Puppet::Type.type(:package).provide(:entropy, :parent => Puppet::Provider::Packa
return packages return packages
rescue Puppet::ExecutionFailure => detail rescue Puppet::ExecutionFailure => detail
raise Puppet::Error.new(detail) raise Puppet::Error.new(detail.message)
end end
end end
@@ -59,7 +59,10 @@ Puppet::Type.type(:package).provide(:entropy, :parent => Puppet::Provider::Packa
# We must install a specific version # We must install a specific version
name = "=#{name}-#{should}" name = "=#{name}-#{should}"
end end
equo "install", name begin
equo "install", name
rescue Puppet::ExecutionFailure => detail
raise Puppet::Error.new(detail.message)
end end
# The common package name format. # The common package name format.
@@ -72,7 +75,10 @@ Puppet::Type.type(:package).provide(:entropy, :parent => Puppet::Provider::Packa
end end
def uninstall def uninstall
equo "remove", package_name begin
equo "remove", package_name
rescue Puppet::ExecutionFailure => detail
raise Puppet::Error.new(detail.message)
end end
def update def update
@@ -141,7 +147,7 @@ Puppet::Type.type(:package).provide(:entropy, :parent => Puppet::Provider::Packa
raise Puppet::Error.new("No package found with the specified name [#{package_name}]") raise Puppet::Error.new("No package found with the specified name [#{package_name}]")
end end
rescue Puppet::ExecutionFailure => detail rescue Puppet::ExecutionFailure => detail
raise Puppet::Error.new(detail) raise Puppet::Error.new(detail.message)
end end
end end