def on_cleanup_error(function, path, excinfo):
                click.secho("warning: failed to remove file or directory: {}\n"
                            "please delete it manually.".format(path),
                            fg="red")
def encode(self):
        if self.version == 6:
            return {'ip6': self.ip_addr}
        else:
            return {'ip4': self.ip_addr}