qubes: fix some error messages

This commit is contained in:
Marek Marczykowski-Górecki 2016-08-17 02:13:59 +02:00
parent 3a2a87839f
commit 53b2b30c0a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 2 additions and 4 deletions

View File

@ -440,9 +440,7 @@ class VMCollection(object):
def __delitem__(self, key): def __delitem__(self, key):
vm = self[key] vm = self[key]
if not vm.is_halted(): if not vm.is_halted():
msg = "Can't remove, vm {!s}, beacuse it's in state {!s}." raise qubes.exc.QubesVMNotHaltedError(vm)
msg = msg.format(vm, vm.get_power_state())
raise qubes.exc.QubesVMNotHaltedError(msg)
self.app.fire_event_pre('domain-pre-delete', vm) self.app.fire_event_pre('domain-pre-delete', vm)
try: try:
vm.libvirt_domain.undefine() vm.libvirt_domain.undefine()

View File

@ -501,7 +501,7 @@ class VMProperty(qubes.property):
raise qubes.exc.QubesVMNotFoundError(value) raise qubes.exc.QubesVMNotFoundError(value)
if not isinstance(vm, self.vmclass): if not isinstance(vm, self.vmclass):
raise TypeError('wrong VM class: domains[{!r}] if of type {!s} ' raise TypeError('wrong VM class: domains[{!r}] is of type {!s} '
'and not {!s}'.format(value, 'and not {!s}'.format(value,
vm.__class__.__name__, vm.__class__.__name__,
self.vmclass.__name__)) self.vmclass.__name__))