def run(self): log.debug('Running task %s with command %s', self.task.name, self.command) exit_code, stdout, stderr = utils.execute(self.command) log.debug( 'Task %s with command %s\n returned code %s\n out %s err%s', self.task.name, self.command, exit_code, stdout, stderr) if exit_code != 0: raise exceptions.Failed() return exit_code
def run(self): log.debug('Running puppet task %s with command %s', self.task.name, self.command) exit_code, stdout, stderr = utils.execute(self.command) log.debug( 'Task %s with command %s\n returned code %s\n out %s err%s', self.task.name, self.command, exit_code, stdout, stderr) # 0 - no changes # 2 - was some changes but successfull # 4 - failures during transaction # 6 - changes and failures if exit_code not in [0, 2]: raise exceptions.Failed() return exit_code
def execute(self, add_command): command = self.base_command + add_command cmd = ' '.join(command) return utils.execute(cmd)
def check_puppet_installed(self): exit_code, out, err = utils.execute('which puppet') if exit_code == 1: self.skipTest('Puppet is not installed')