def main():
try:
conn = openReadOnly(None)
except libvirtError as error:
print('WARNING: could not connect to libvirt: ' + str(error))
exit(1)
inactive_domains = [d for d in conn.listAllDomains() if not d.isActive()]
if inactive_domains:
print('WARNING: ' + ', '.join(
'{} is defined but not running'.format(d.name())
for d in inactive_domains
))
exit(1)
print('OK: all defined domains are running')
exit(0)
评论列表
文章目录