mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02:00
Catch Permission denied when writing to VMX file while closing VMware VM. Fixes #277.
This commit is contained in:
parent
382747a2f2
commit
31b168aa42
@ -437,7 +437,10 @@ class VMwareVM(BaseVM):
|
|||||||
log.debug("enabling remaining adapter {}".format(adapter_number))
|
log.debug("enabling remaining adapter {}".format(adapter_number))
|
||||||
self._vmx_pairs["ethernet{}.startconnected".format(adapter_number)] = "TRUE"
|
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))
|
log.info("VMware VM '{name}' [{id}] stopped".format(name=self.name, id=self.id))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user