From 204845541055500ae2b19da027cc96fe9f7ef624 Mon Sep 17 00:00:00 2001 From: gryf Date: Tue, 6 Jul 2021 19:50:31 +0200 Subject: [PATCH] Fix issue with undefined port. --- box.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/box.py b/box.py index d2bcb17..d44a857 100755 --- a/box.py +++ b/box.py @@ -653,8 +653,7 @@ class VBoxManage: if not self.uuid: raise BoxVBoxFailure(f'Cannot create VM "{self.name_or_uuid}".') - if not conf.port: - port = self._find_unused_port() + port = conf.port if conf.port else self._find_unused_port() cmd = ['vboxmanage', 'modifyvm', self.name_or_uuid, '--memory', str(memory),