mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 23:43:48 +02:00
Fixes KeyError: "ethernet0.connectiontype". Fixes #276.
This commit is contained in:
parent
1419b7c8dc
commit
a721d7d910
@ -199,7 +199,7 @@ class VMwareVM(BaseVM):
|
|||||||
# check if any vmnet interface managed by GNS3 is being used on existing VMware adapters
|
# check if any vmnet interface managed by GNS3 is being used on existing VMware adapters
|
||||||
if self._get_vmx_setting("ethernet{}.present".format(adapter_number), "TRUE"):
|
if self._get_vmx_setting("ethernet{}.present".format(adapter_number), "TRUE"):
|
||||||
connection_type = "ethernet{}.connectiontype".format(adapter_number)
|
connection_type = "ethernet{}.connectiontype".format(adapter_number)
|
||||||
if self._vmx_pairs[connection_type] in ("hostonly", "custom"):
|
if connection_type in self._vmx_pairs and self._vmx_pairs[connection_type] in ("hostonly", "custom"):
|
||||||
vnet = "ethernet{}.vnet".format(adapter_number)
|
vnet = "ethernet{}.vnet".format(adapter_number)
|
||||||
if vnet in self._vmx_pairs:
|
if vnet in self._vmx_pairs:
|
||||||
vmnet = os.path.basename(self._vmx_pairs[vnet])
|
vmnet = os.path.basename(self._vmx_pairs[vnet])
|
||||||
@ -217,8 +217,7 @@ class VMwareVM(BaseVM):
|
|||||||
if self._get_vmx_setting("ethernet{}.present".format(adapter_number), "TRUE"):
|
if self._get_vmx_setting("ethernet{}.present".format(adapter_number), "TRUE"):
|
||||||
# check for the connection type
|
# check for the connection type
|
||||||
connection_type = "ethernet{}.connectiontype".format(adapter_number)
|
connection_type = "ethernet{}.connectiontype".format(adapter_number)
|
||||||
if connection_type in self._vmx_pairs:
|
if connection_type in self._vmx_pairs and self._vmx_pairs[connection_type] in ("nat", "bridged", "hostonly"):
|
||||||
if self._vmx_pairs[connection_type] in ("nat", "bridged", "hostonly"):
|
|
||||||
raise VMwareError("Attachment ({}) already configured on network adapter {}. "
|
raise VMwareError("Attachment ({}) already configured on network adapter {}. "
|
||||||
"Please remove it or allow GNS3 to use any adapter.".format(self._vmx_pairs[connection_type],
|
"Please remove it or allow GNS3 to use any adapter.".format(self._vmx_pairs[connection_type],
|
||||||
adapter_number))
|
adapter_number))
|
||||||
|
Loading…
Reference in New Issue
Block a user