Fixed error in displaying error on VM Rename

VM rename was incorrectly trying to display an error by itself and not
use QThreads embedded mechanism.

fixes QubesOS/qubes-issues#4843
fixes QubesOS/qubes-issues#4767
This commit is contained in:
Marta Marczykowska-Górecka 2019-02-26 21:05:42 +01:00
parent 9afa6faca0
commit 26779a4826
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -68,22 +68,18 @@ class RenameVMThread(QtCore.QThread):
setattr(holder, prop, new_vm) setattr(holder, prop, new_vm)
except qubesadmin.exc.QubesException: except qubesadmin.exc.QubesException:
failed_props += [(holder, prop)] failed_props += [(holder, prop)]
if not failed_props: if not failed_props:
del self.vm.app.domains[self.vm.name] del self.vm.app.domains[self.vm.name]
else: else:
list_text = utils.format_dependencies_list(failed_props) list_text = utils.format_dependencies_list(failed_props)
self.msg = (self.tr("Warning: rename partially unsuccessful!"),
QtGui.QMessageBox.warning( self.tr("Some properties could not be changed to "
None, "the new name. The system has now both {} "
self.tr("Warning: rename partially unsuccessful"), "and {} qubes. To resolve this, please "
self.tr("Some properties could not be changed to the new " "check and change the following properties "
"name. The system has now both {} and {} qubes. " "and remove the qube {} manually.<br>"
"To resolve this, please check and change the " ).format(self.vm.name, self.vm.name,
"following properties and remove the qube {} " self.vm.name) + list_text)
"manually.<br> ").format(
self.vm.name, self.vm.name, self.vm.name)\
+ list_text)
except qubesadmin.exc.QubesException as ex: except qubesadmin.exc.QubesException as ex:
self.msg = ("Rename error!", str(ex)) self.msg = ("Rename error!", str(ex))