Exemple #1
0
    def local(self, cmd, *args, **kwargs):
        cmd = self._wrap_cmd(cmd, 'lcwd')
        self._output(prefixlines('localhost', "running", cmd, "blue"))
        start = time.time()
        status = local(cmd, output=False, *args, **kwargs)
        end = time.time()
        try:
            self._check_status(status)
        except BadReturnCode:
            self._output(cmd_status(end - start, 'localhost', cmd,
                                    status, state='failed', color="red"),
                         logging.warning)
            raise

        self._output(cmd_status(end - start, 'localhost', cmd, status))
        return status
Exemple #2
0
    def local(self, cmd, *args, **kwargs):
        cmd = self._wrap_cmd(cmd, 'lcwd')
        self._output(prefixlines('localhost', "running", cmd, "blue"))
        start = time.time()
        status = local(cmd, output=False, *args, **kwargs)
        end = time.time()
        try:
            self._check_status(status)
        except BadReturnCode:
            self._output(
                cmd_status(end - start,
                           'localhost',
                           cmd,
                           status,
                           state='failed',
                           color="red"), logging.warning)
            raise

        self._output(cmd_status(end - start, 'localhost', cmd, status))
        return status
Exemple #3
0
 def local(self, cmd, *args, **kwargs):
     cmd = self._wrap_cmd(cmd, "lcwd")
     status = local(cmd, output=False, *args, **kwargs)
     self._output("localhost", cmd, status)
     return status
Exemple #4
0
 def local(self, cmd, *args, **kwargs):
     cmd = self._wrap_cmd(cmd, "lcwd")
     return local(cmd, *args, **kwargs)