From daadcdd12a713ad15a63e644b5b7aa1ffe23d308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Thu, 8 Oct 2020 16:37:25 +0200 Subject: [PATCH] log vm status when vagrant up fails --- fdroidserver/vmtools.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/fdroidserver/vmtools.py b/fdroidserver/vmtools.py index bd8aae60..b32502f0 100644 --- a/fdroidserver/vmtools.py +++ b/fdroidserver/vmtools.py @@ -209,7 +209,22 @@ class FDroidBuildVm(): self.vgrnt.up(provision=provision, provider=self.provider) self.srvuuid = self._vagrant_fetch_uuid() except subprocess.CalledProcessError as e: - raise FDroidBuildVmException("could not bring up vm '%s'" % self.srvname) from e + statusline = "" + try: + # try to get some additional info about the vagrant vm + status = self.vgrnt.status() + if len(status) > 0: + statusline = "VM status: name={n}, state={s}, provider={p}"\ + .format(n=status[0].name, + s=status[0].state, + p=status[0].provider) + except subprocess.CalledProcessError: + pass + raise FDroidBuildVmException(value="could not bring up vm '{vmname}'" + .format(vmname=self.srvname), + detail="{err}\n{statline}" + .format(err=str(e), statline=statusline) + ) from e def suspend(self): global lock