Commit 8bfcf8aa authored by Anael Beutot's avatar Anael Beutot Committed by Sébastien Luttringer
Browse files

Added pause option to start command

If specified, the matched VMs will be started in pause state.
parent ac9b7168
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -30,6 +30,8 @@ class Command_start(TqlCommand):
    def __init__(self, cli, argv0):
    def __init__(self, cli, argv0):
        TqlCommand.__init__(self, cli, argv0)
        TqlCommand.__init__(self, cli, argv0)
        self.tql_filter += "&r=vm&status=stopped"
        self.tql_filter += "&r=vm&status=stopped"
        self.add_option('-p', '--pause', action='store_true', dest='pause',
                        default=False, help='Start VM in pause state')


    def __call__(self, argv):
    def __call__(self, argv):
        # arg parse
        # arg parse
@@ -37,7 +39,7 @@ class Command_start(TqlCommand):
        if len(self.args) != 1:
        if len(self.args) != 1:
            raise cmdBadArgument()
            raise cmdBadArgument()
        # rpc call
        # rpc call
        self.rpccall("start", self.args[0])
        self.rpccall("start", self.args[0], self.options.pause)


    def remote_functions(self):
    def remote_functions(self):
        return set(("start",))
        return set(("start",))