]> git.proxmox.com Git - pve-common.git/commit
tools: unbless errors in run_fork_with_timeout
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 4 Jun 2018 08:39:34 +0000 (10:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Jun 2018 10:55:57 +0000 (12:55 +0200)
commit893ec6f2597c41dd048488534df1d2b6603639d8
tree7def8828537afcb60576e1eba5e37f8d64695ad9
parentd86dc5eeafcf384cb0a6891aaa7c149854abdbbc
tools: unbless errors in run_fork_with_timeout

We cannot properly encode blessed objects as json, so
instead, we should stringify them. This happened for
instance if a VM's systemd scope wasn't cleaned up as we
got an error as a Net::DBus::Error object causing a
"malformed json string" error to appear instead of the
actual message.

Additionally, add a 'must_stringify' helper: The above error
object implements a '""' operator for stringification (as
all error should), but in theory that could die as well, in
which case we just return a generic error string we'll
hopefully never see...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/Tools.pm