Skip to content
Snippets Groups Projects
  • Seblu's avatar
    98a60864
    Improve commands loading · 98a60864
    Seblu authored
    Commands loading is now done by crawling commands directory under cccli module.
    All command which starts by Commmand_ and which is a son of Command class are candidate.
    98a60864
    History
    Improve commands loading
    Seblu authored
    Commands loading is now done by crawling commands directory under cccli module.
    All command which starts by Commmand_ and which is a son of Command class are candidate.
kill.py 688 B
#!/usr/bin/env python
#coding=utf8

'''
CloudControl Connection related commands
'''

from cccli.exception import *
from sjrpc.core.exceptions import *
from cccli.printer import Printer, color
from cccli.command import TqlCommand

class Command_kill(TqlCommand):
    '''Kill a server connection'''

    def __init__(self, cli, argv0):
        TqlCommand.__init__(self, cli, argv0)
        self.tql_filter += "&con"

    def __call__(self, argv):
        # args parse
        self.parse_args(argv)
        if len(self.args) != 1:
            raise cmdBadArgument()
        # rpccall
        self.rpccall("kill", self.args[0])

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