core3: more fixes
This commit is contained in:
parent
80d664441d
commit
0fbee4dc10
@ -640,7 +640,7 @@ class property(object): # pylint: disable=redefined-builtin,invalid-name
|
|||||||
|
|
||||||
if self._setter is not None:
|
if self._setter is not None:
|
||||||
value = self._setter(instance, self, value)
|
value = self._setter(instance, self, value)
|
||||||
if self._type is not None: # XXX what about QubesVM and other types?
|
if self._type not in (None, type(value)):
|
||||||
value = self._type(value)
|
value = self._type(value)
|
||||||
|
|
||||||
if has_oldvalue:
|
if has_oldvalue:
|
||||||
@ -1333,7 +1333,7 @@ class Qubes(PropertyHolder):
|
|||||||
# then search for name
|
# then search for name
|
||||||
for l in self.labels.values():
|
for l in self.labels.values():
|
||||||
if l.name == label:
|
if l.name == label:
|
||||||
return label
|
return l
|
||||||
|
|
||||||
# last call, if label is a number represented as str, search in indices
|
# last call, if label is a number represented as str, search in indices
|
||||||
try:
|
try:
|
||||||
|
@ -158,7 +158,7 @@ class QubesVM(qubes.vm.BaseVM):
|
|||||||
ls_width=31,
|
ls_width=31,
|
||||||
doc='User-specified name of the domain.')
|
doc='User-specified name of the domain.')
|
||||||
|
|
||||||
uuid = qubes.property('uuid', type=uuid.UUID, default=None,
|
uuid = qubes.property('uuid', type=uuid.UUID,
|
||||||
ls_width=36,
|
ls_width=36,
|
||||||
doc='UUID from libvirt.')
|
doc='UUID from libvirt.')
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ class QubesVM(qubes.vm.BaseVM):
|
|||||||
|
|
||||||
# XXX _update_libvirt_domain?
|
# XXX _update_libvirt_domain?
|
||||||
try:
|
try:
|
||||||
if self.uuid is not None:
|
if hasattr(self, 'uuid'):
|
||||||
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
||||||
self.uuid.bytes)
|
self.uuid.bytes)
|
||||||
else:
|
else:
|
||||||
|
@ -19,7 +19,8 @@ class TemplateVM(qubes.vm.qubesvm.QubesVM):
|
|||||||
super(TemplateVM, self).__init__(*args, **kwargs)
|
super(TemplateVM, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
# Some additional checks for template based VM
|
# Some additional checks for template based VM
|
||||||
assert self.root_img is not None, "Missing root_img for standalone VM!"
|
# TODO find better way
|
||||||
|
# assert self.root_img is not None, "Missing root_img for standalone VM!"
|
||||||
|
|
||||||
|
|
||||||
def clone_disk_files(self, src):
|
def clone_disk_files(self, src):
|
||||||
|
Loading…
Reference in New Issue
Block a user