Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 def execute(self, add_command):
     command = self.base_command + add_command
     cmd = ' '.join(command)
     return utils.execute(cmd)
Esempio n. 4
0
 def check_puppet_installed(self):
     exit_code, out, err = utils.execute('which puppet')
     if exit_code == 1:
         self.skipTest('Puppet is not installed')
Esempio n. 5
0
 def execute(self, add_command):
     command = self.base_command + add_command
     cmd = ' '.join(command)
     return utils.execute(cmd)
Esempio n. 6
0
 def check_puppet_installed(self):
     exit_code, out, err = utils.execute('which puppet')
     if exit_code == 1:
         self.skipTest('Puppet is not installed')