From 15895aa22fce509410d59c0bb3ef79905e0d2b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Tue, 16 Jun 2015 18:48:21 +0200 Subject: [PATCH] Add title command --- cloudcontrol/cli/commands/vm.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cloudcontrol/cli/commands/vm.py b/cloudcontrol/cli/commands/vm.py index bbee789..6304837 100644 --- a/cloudcontrol/cli/commands/vm.py +++ b/cloudcontrol/cli/commands/vm.py @@ -300,3 +300,23 @@ class Command_unrescue(TqlCommand): def remote_functions(self): return set(("unrescue",)) + +class Command_title(TqlCommand): + '''Set a vm title''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.set_usage("%prog [options] ") + self.tql_filter += "&r=vm" + self.remove_option("--direct") + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 2: + raise cmdBadArgument() + # rpc call + self.rpccall("title", self.args[0], self.args[1], _direct=True) + + def remote_functions(self): + return set(("title",)) -- GitLab