def METHOD_NAME(self):
    conf_dir = self.fname.parent
    if not conf_dir.is_dir():
        conf_dir.mkdir(0o700, parents=True)
    with self.fname.open("w") as fd:
        json.dump(self, fd, indent=2)