Created
November 11, 2013 20:48
-
-
Save ties/7420083 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
The libvirt API is much easier than my old kludge based on `virsh list` and sed… | |
""" | |
import libvirt | |
conn = libvirt.open(None) | |
for id in conn.listDomainsID(): | |
domain = conn.lookupByID(id) | |
domain.shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment