qubes: fix some error messages
This commit is contained in:
parent
3a2a87839f
commit
53b2b30c0a
@ -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()
|
||||||
|
@ -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__))
|
||||||
|
Loading…
Reference in New Issue
Block a user