| 37 | self.config[line.split("=")[0]] = line.split("=")[1].strip() |
| 38 | |
| 39 | def shutdown(self): |
| 40 | if self.proc is not None: |
| 41 | print ("Shutting down %s" % self.name) |
| 42 | self.proc.terminate() |
| 43 | # FIXME determine why we need 30+ seconds to shut down with a tiny regtest chain |
| 44 | self.proc.wait(120) |
| 45 | self.proc = None |
| 46 | |
| 47 | if self.datadir_path is not None: |
| 48 | if self.cleanup_on_exit: |
| 49 | shutil.rmtree(self.datadir_path) |
| 50 | else: |
| 51 | print ("Leaving %s datadir at %s." % (self.name, self.datadir_path)) |
| 52 | |
| 53 | def start(self, ext_args = None, keep_datadir = False): |
| 54 | if keep_datadir and self.datadir_path is not None: |