1
0
mirror of https://github.com/GNS3/gns3-server synced 2025-01-23 06:20:59 +00:00

Catch Permission denied when writing to VMX file while closing VMware VM. Fixes #277.

This commit is contained in:
Jeremy 2015-07-25 17:09:10 -06:00
parent 382747a2f2
commit 31b168aa42

View File

@ -437,7 +437,10 @@ class VMwareVM(BaseVM):
log.debug("enabling remaining adapter {}".format(adapter_number))
self._vmx_pairs["ethernet{}.startconnected".format(adapter_number)] = "TRUE"
self.manager.write_vmx_file(self._vmx_path, self._vmx_pairs)
try:
self.manager.write_vmx_file(self._vmx_path, self._vmx_pairs)
except OSError as e:
raise VMwareError('Could not write VMware VMX file "{}": {}'.format(self._vmx_path, e))
log.info("VMware VM '{name}' [{id}] stopped".format(name=self.name, id=self.id))