fixed on and off domains
This commit is contained in:
parent
61a44db2f9
commit
70ff6022ca
6
main.py
6
main.py
@ -6,14 +6,12 @@ session = libvirt.open('qemu:///system')
|
||||
|
||||
def listVDS():
|
||||
VdsListVar = list()
|
||||
for i, vdsName in enumerate(session.listDefinedDomains()):
|
||||
dom = session.lookupByName(vdsName)
|
||||
VdsListVar.append(dict(name=vdsName,state=dom.isActive()))
|
||||
for domain in session.listAllDomains(0):
|
||||
VdsListVar.append(dict(name=domain.name(),state=domain.isActive()))
|
||||
return VdsListVar
|
||||
|
||||
@route('/')
|
||||
def index():
|
||||
# return 'Привет, мир!'
|
||||
return str(listVDS())
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user