(self)
| 56 | self.new_config = [] |
| 57 | |
| 58 | def commit(self): |
| 59 | if not self.is_changed(): |
| 60 | logging.info("Nothing to commit. The %s file did not change" % self.filename) |
| 61 | return False |
| 62 | handle = open(self.filename, "w+") |
| 63 | for line in self.new_config: |
| 64 | handle.write(line) |
| 65 | handle.close() |
| 66 | logging.info("Wrote edited file %s" % self.filename) |
| 67 | self.config = list(self.new_config) |
| 68 | logging.info("Updated file in-cache configuration") |
| 69 | return True |
| 70 | |
| 71 | def dump(self): |
| 72 | for line in self.new_config: |
no test coverage detected