Skip to content
Snippets Groups Projects
Commit 7185888a authored by Aurélien Dunand's avatar Aurélien Dunand
Browse files

Add install/uninstall command

parent 45728f15
No related branches found
No related tags found
No related merge requests found
......@@ -331,6 +331,42 @@ class Command_unrescue(TqlCommand):
def remote_functions(self):
return set(("unrescue",))
class Command_install(TqlCommand):
'''Switch VMs to install mode'''
def __init__(self, cli, argv0):
TqlCommand.__init__(self, cli, argv0)
self.tql_filter += "&r=vm&status=stopped&mode=normal"
def __call__(self, argv):
# arg parse
self.parse_args(argv)
if len(self.args) != 1:
raise cmdBadArgument()
# rpc call
self.rpccall("install", self.args[0])
def remote_functions(self):
return set(("install",))
class Command_uninstall(TqlCommand):
'''Switch VMs back from install mode'''
def __init__(self, cli, argv0):
TqlCommand.__init__(self, cli, argv0)
self.tql_filter += "&r=vm&status=stopped&mode=install"
def __call__(self, argv):
# arg parse
self.parse_args(argv)
if len(self.args) != 1:
raise cmdBadArgument()
# rpc call
self.rpccall("uninstall", self.args[0])
def remote_functions(self):
return set(("uninstall",))
class Command_title(TqlCommand):
'''Set a VM title'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment