vm: add TemplateVM.appvms property - list of VMs based on it
This commit is contained in:
parent
024ac6a810
commit
d0bcd3ead2
@ -72,6 +72,13 @@ class QubesVM(qubesadmin.base.PropertyHolder):
|
|||||||
return self.name < other.name
|
return self.name < other.name
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
if isinstance(other, QubesVM):
|
||||||
|
return self.name == other.name
|
||||||
|
elif isinstance(other, str):
|
||||||
|
return self.name == other
|
||||||
|
return NotImplemented
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
'''
|
'''
|
||||||
Start domain.
|
Start domain.
|
||||||
@ -288,6 +295,17 @@ class StandaloneVM(QubesVM):
|
|||||||
|
|
||||||
class TemplateVM(QubesVM):
|
class TemplateVM(QubesVM):
|
||||||
'''Template for AppVM'''
|
'''Template for AppVM'''
|
||||||
|
|
||||||
|
@property
|
||||||
|
def appvms(self):
|
||||||
|
''' Returns a generator containing all domains based on the current
|
||||||
|
TemplateVM.
|
||||||
|
'''
|
||||||
|
for vm in self.app.domains:
|
||||||
|
try:
|
||||||
|
if vm.template == self:
|
||||||
|
yield vm
|
||||||
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user