From ddf65af7f55afe7a73dd92b6e3f6c162583f387e Mon Sep 17 00:00:00 2001 From: Seblu <sebastien.luttringer@smartjog.com> Date: Thu, 17 Mar 2011 11:32:08 +0100 Subject: [PATCH] add command undefine --- cccli/command/vm.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cccli/command/vm.py b/cccli/command/vm.py index 14dbb4c..9198c91 100644 --- a/cccli/command/vm.py +++ b/cccli/command/vm.py @@ -86,3 +86,20 @@ class Command_resume(TqlCommand): raise cmdBadArgument() # rpc call self.rpccall("resume", self.args[0]) + +class Command_undefine(TqlCommand): + '''Undefine a stopped vm''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.tql_filter += "&r=vm&status=stopped" + self.add_option("-c", "--clean", action="store_true", dest="clean", default=False, + help="Remove storage") + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 1: + raise cmdBadArgument() + # rpc call + self.rpccall("undefine", self.args[0], self.options.clean) -- GitLab