

def rollback_checkpoints(self, rollback=1):
    'Revert \'rollback\' number of configuration checkpoints.\n\n        :param int rollback: Number of checkpoints to reverse. A str num will be\n           cast to an integer. So "2" is also acceptable.\n\n        :raises .ReverterError:\n            if there is a problem with the input or if the function is\n            unable to correctly revert the configuration checkpoints\n\n        '
    try:
        rollback = int(rollback)
    except ValueError:
        logger.error('Rollback argument must be a positive integer')
        raise errors.ReverterError('Invalid Input')
    if (self < 0):
        logger.error('Rollback argument must be a positive integer')
        raise errors.ReverterError('Invalid Input')
    backups = os.listdir(self.config.backup_dir)
    backups.sort()
    if (not backups):
        logger.warning("Certbot hasn't modified your configuration, so rollback isn't available.")
    elif (len(backups) < rollback):
        logger.warning('Unable to rollback %d checkpoints, only %d exist', rollback, len(backups))
    while ((rollback > 0) and backups):
        cp_dir = os.path.join(self.config.backup_dir, backups.pop())
        try:
            self._recover_checkpoint(cp_dir)
        except errors.ReverterError:
            logger.fatal('Failed to load checkpoint during rollback')
            raise errors.ReverterError('Unable to load checkpoint during rollback')
        rollback -= 1

dataset/ETHPy150Open letsencrypt/letsencrypt/certbot/reverter.py Reverter.rollback_checkpoints/VarMisuse@51/214 `rollback`->`self`