qubesvm: don't crash VM creation if icon symlink already exists
It can be leftover from previous failed attempt. Don't crash on it, and replace it instead. QubesOS/qubes-issues#3438
This commit is contained in:
parent
c01ae06fee
commit
ba210c41ee
@ -1439,6 +1439,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
'creation'.format(self.dir_path))
|
'creation'.format(self.dir_path))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
if os.path.exists(self.icon_path):
|
||||||
|
os.unlink(self.icon_path)
|
||||||
self.log.info('Creating icon symlink: {} -> {}'.format(
|
self.log.info('Creating icon symlink: {} -> {}'.format(
|
||||||
self.icon_path, self.label.icon_path))
|
self.icon_path, self.label.icon_path))
|
||||||
if hasattr(os, "symlink"):
|
if hasattr(os, "symlink"):
|
||||||
|
Loading…
Reference in New Issue
Block a user