Example #1
0
    def check_syntax(self, ip_type, filename):
        out, err, ret = run_command("{} -{} -t -cf {}".format(
            self.dhcpd, ip_type, os.path.join(self.stage_dir, filename)))

        if ret != 0:
            log_msg = 'DHCP build failed due to a syntax error'
            exception_msg = log_msg + ('\n{0} said:\n{1}'.format(
                self.dhcpd, err))

            self.error(log_msg)
Example #2
0
    def run_command(self, command, log=True, failure_msg=None):
        if log:
            command_logger = self.log_debug
            failure_logger = self.log_err
        else:
            command_logger = None
            failure_logger = None

        return run_command(command, command_logger=command_logger,
                           failure_logger=failure_logger,
                           failure_msg=failure_msg)
Example #3
0
    def check_syntax(self):
        out, err, ret = run_command("{0} -t -cf {1}".format(
            self.dhcpd, os.path.join(self.stage_dir, self.check_file)))

        if ret != 0:
            log_msg = 'DHCP build failed due to a syntax error'
            exception_msg = log_msg + ('\n{0} said:\n{1}'.format(
                self.dhcpd, err))

            self.log_err(log_msg, to_stderr=False)
            raise Exception(exception_msg)
Example #4
0
    def check_syntax(self, ip_type, filename):
        out, err, ret = run_command("{} -{} -t -cf {}".format(
            self.dhcpd, ip_type, os.path.join(self.stage_dir, filename)
        ))

        if ret != 0:
            log_msg = 'DHCP build failed due to a syntax error'
            exception_msg = log_msg + ('\n{0} said:\n{1}'
                                       .format(self.dhcpd, err))

            self.error(log_msg)
Example #5
0
def _run_command(self, command, log=True, failure_msg=None,
                 ignore_failure=False):
    if log:
        command_logger = self._log
        failure_logger = lambda msg: self._log(msg, log_level='LOG_ERR')
    else:
        command_logger, failure_logger = None, None

    return run_command(
        command, command_logger=command_logger,
        failure_logger=failure_logger, failure_msg=failure_msg,
        ignore_failure=ignore_failure)
Example #6
0
    def run_command(self, command, log=True, failure_msg=None):
        if log:
            command_logger = self.log_debug
            failure_logger = self.log_err
        else:
            command_logger = None
            failure_logger = None

        return run_command(command,
                           command_logger=command_logger,
                           failure_logger=failure_logger,
                           failure_msg=failure_msg)
Example #7
0
def _run_command(self,
                 command,
                 log=True,
                 failure_msg=None,
                 ignore_failure=False):
    if log:
        command_logger = self._log
        failure_logger = lambda msg: self._log(msg, log_level='LOG_ERR')
    else:
        command_logger, failure_logger = None, None

    return run_command(command,
                       command_logger=command_logger,
                       failure_logger=failure_logger,
                       failure_msg=failure_msg,
                       ignore_failure=ignore_failure)
Example #8
0
File: vcs.py Project: zeeman/cyder
 def _run_command(self, command, ignore_failure=False):
     return run_command(command, logger=self.logger,
                        ignore_failure=ignore_failure)
Example #9
0
File: vcs.py Project: zeeman/cyder
 def clone(self, source, dest):
     run_command('git clone {0} {1}'.format(source, dest))
     with ChdirHandler(dest):
         self._update_git_config(self.config)
Example #10
0
 def run_command(self, command, failure_msg=None):
     return run_command(command, logger=self, failure_msg=failure_msg)
Example #11
0
 def run_command(self, command, failure_msg=None):
     return run_command(command, logger=self, failure_msg=failure_msg)
Example #12
0
 def _run_command(self, command, ignore_failure=False):
     return run_command(command,
                        logger=self.logger,
                        ignore_failure=ignore_failure)
Example #13
0
 def clone(self, source, dest):
     run_command('git clone {0} {1}'.format(source, dest))
     with ChdirHandler(dest):
         self._update_git_config(self.config)