X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/2125e869604558b82c61dfc788400a9a29fcc791..6c24c84e935979be713f74558dbaa7fc0a004749:/code/controls.py diff --git a/code/controls.py b/code/controls.py index 050b365..b946666 100644 --- a/code/controls.py +++ b/code/controls.py @@ -196,6 +196,13 @@ def statusInfo(machine): status = parseStatus(value_string) return status +def listHost(machine): + """Return the host a machine is running on""" + out, err = remctl('control', machine.name, 'listhost', err=True) + if err: + return None + return out.strip() + def deleteVM(machine): """Delete a VM.""" remctl('control', machine.name, 'destroy', err=True)