def register_undo_command(self, temporary, command):
        commands_fp = os.path.join(self._get_cp_dir(temporary), "COMMANDS")
        command_file = None
        try:
            if os.path.isfile(commands_fp):
                command_file = open(commands_fp, "ab")
            else:
                command_file = open(commands_fp, "wb")

            csvwriter = csv.writer(command_file)
            csvwriter.writerow(command)

        except (IOError, OSError):
            logger.error("Unable to register undo command")
            raise errors.ReverterError(
                "Unable to register undo command.")
        finally:
            if command_file is not None:
                command_file.close()
Register a command to be run to undo actions taken.
dataset/ETHPy150Open letsencrypt/letsencrypt/certbot/reverter.py/Reverter.register_undo_command