diff --git a/lib/extconfig.py b/lib/extconfig.py index 9ed9224858..28446ae053 100644 --- a/lib/extconfig.py +++ b/lib/extconfig.py @@ -1158,6 +1158,10 @@ def _write_cf(self, buff): with codecs.open(fpath, "w", "utf8") as ofile: ofile.write(buff) ofile.flush() + report = self._validate_config(fpath) + if report["errors"]: + os.unlink(fpath) + raise ex.excError("the change was not saved") shutil.move(fpath, self.paths.cf) def print_config_data(self, src_config=None, evaluate=False, impersonate=None):