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():
|
def listVDS():
|
||||||
VdsListVar = list()
|
VdsListVar = list()
|
||||||
for i, vdsName in enumerate(session.listDefinedDomains()):
|
for domain in session.listAllDomains(0):
|
||||||
dom = session.lookupByName(vdsName)
|
VdsListVar.append(dict(name=domain.name(),state=domain.isActive()))
|
||||||
VdsListVar.append(dict(name=vdsName,state=dom.isActive()))
|
|
||||||
return VdsListVar
|
return VdsListVar
|
||||||
|
|
||||||
@route('/')
|
@route('/')
|
||||||
def index():
|
def index():
|
||||||
# return 'Привет, мир!'
|
|
||||||
return str(listVDS())
|
return str(listVDS())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user