From 55fed0229903486b3f6854f88df11f7392d8027e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 14 Apr 2015 14:35:48 +0200 Subject: [PATCH] Fix a crash when in some cases you can't access to VBOX state Fix #137 --- gns3server/modules/virtualbox/virtualbox_vm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index 2ff8511c..428d880c 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -105,9 +105,10 @@ class VirtualBoxVM(BaseVM): results = yield from self.manager.execute("showvminfo", [self._vmname, "--machinereadable"]) for info in results: - name, value = info.split('=', 1) - if name == "VMState": - return value.strip('"') + if '=' in info: + name, value = info.split('=', 1) + if name == "VMState": + return value.strip('"') raise VirtualBoxError("Could not get VM state for {}".format(self._vmname)) @asyncio.coroutine