mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-05-29 22:04:31 +00:00
Fix crash
This commit is contained in:
parent
d19b3f15ed
commit
dd7f6eb021
@ -171,7 +171,7 @@ class VMware(BaseManager):
|
|||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
return # FIXME: no version checking on Mac OS X
|
return # FIXME: no version checking on Mac OS X
|
||||||
else:
|
else:
|
||||||
vmware_path = self._get_linux_vmware_binary()
|
vmware_path = VMware._get_linux_vmware_binary()
|
||||||
|
|
||||||
if vmware_path is None:
|
if vmware_path is None:
|
||||||
raise VMwareError("VMware is not installed (vmware executable could not be found in $PATH)")
|
raise VMwareError("VMware is not installed (vmware executable could not be found in $PATH)")
|
||||||
@ -438,7 +438,7 @@ class VMware(BaseManager):
|
|||||||
with open(path, "w", encoding=encoding, errors="ignore") as f:
|
with open(path, "w", encoding=encoding, errors="ignore") as f:
|
||||||
if sys.platform.startswith("linux"):
|
if sys.platform.startswith("linux"):
|
||||||
# write the shebang on the first line on Linux
|
# write the shebang on the first line on Linux
|
||||||
vmware_path = self._get_linux_vmware_binary()
|
vmware_path = VMware._get_linux_vmware_binary()
|
||||||
if vmware_path:
|
if vmware_path:
|
||||||
f.write("#!{}\n".format(vmware_path))
|
f.write("#!{}\n".format(vmware_path))
|
||||||
for key, value in pairs.items():
|
for key, value in pairs.items():
|
||||||
@ -578,7 +578,8 @@ class VMware(BaseManager):
|
|||||||
raise VMwareError('Could not find the default VM directory: "{}"'.format(default_vm_path))
|
raise VMwareError('Could not find the default VM directory: "{}"'.format(default_vm_path))
|
||||||
return self._get_vms_from_directory(default_vm_path)
|
return self._get_vms_from_directory(default_vm_path)
|
||||||
|
|
||||||
def _get_linux_vmware_binary(self):
|
@staticmethod
|
||||||
|
def _get_linux_vmware_binary():
|
||||||
"""
|
"""
|
||||||
Return the path of the vmware binary on Linux or None
|
Return the path of the vmware binary on Linux or None
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user