(self, path, string, mode='w')
| 286 | self.write_string_to_file(config_path, '\n'.join(configs), mode=mode) |
| 287 | |
| 288 | def write_string_to_file(self, path, string, mode='w'): |
| 289 | if mode == 'a': |
| 290 | redirect = '>>' |
| 291 | else: |
| 292 | redirect = '>' |
| 293 | self.print_cmd("cat << 'EOF' {} {}\n{}\nEOF".format(redirect, path, string)) |
| 294 | if not self.dry_run: |
| 295 | with open(path, mode) as f: |
| 296 | f.write(string) |
no test coverage detected