LOG.info(_("Checking syntax correctness of named.conf ..."))
cmd = shlex.split(str(self.cmd_checkconf))
- if 'named-checkconf' in self.cmd_checkconf and self.verbose > 2:
+ if self.verbose > 2:
cmd.append('-p')
cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmd))
LOG.debug(_("Executing: {}").format(cmd_str))
- std_out = None
- std_err = None
- ret_val = None
-
- with Popen(cmd, stdout=PIPE, stderr=PIPE) as proc:
- try:
- std_out, std_err = proc.communicate(timeout=10)
- except TimeoutExpired:
- proc.kill()
- std_out, std_err = proc.communicate()
- ret_val = proc.wait()
+ result = super(BaseApplication, self).run(
+ cmd, stdout=PIPE, stderr=PIPE, timeout=10, check=False, may_simulate=False)
- LOG.debug(_("Return value: {!r}").format(ret_val))
- if std_out and std_out.strip():
- LOG.warn(_("Output on {}").format('STDOUT') + ' ' + to_str(std_out.strip()))
- if std_err and std_err.strip():
- LOG.warn(_("Output on {}").format('STDERR') + ' ' + to_str(std_err.strip()))
+ if self.verbose > 2:
+ LOG.debug(_("Result:") + '\n' + str(result))
- if ret_val:
+ if result.returncode:
return False
-
return True
+# std_out = None
+# std_err = None
+# ret_val = None
+
+# with Popen(cmd, stdout=PIPE, stderr=PIPE) as proc:
+# try:
+# std_out, std_err = proc.communicate(timeout=10)
+# except TimeoutExpired:
+# proc.kill()
+# std_out, std_err = proc.communicate()
+# ret_val = proc.wait()
+
+# LOG.debug(_("Return value: {!r}").format(ret_val))
+# if std_out and std_out.strip():
+# LOG.warn(_("Output on {}").format('STDOUT') + ' ' + to_str(std_out.strip()))
+# if std_err and std_err.strip():
+# LOG.warn(_("Output on {}").format('STDERR') + ' ' + to_str(std_err.strip()))
+
+# if ret_val:
+# return False
+
+# return True
+
# -------------------------------------------------------------------------
def apply_config(self):