@transaction.atomic
    def handle(self, *args, **options):
        save_point = transaction.savepoint()

        try:
            self.migrate_data(*args, **options)
        except Exception as e:
            self.error("Error happens: %s" % e)
            self.error("Rollback all changes")
            transaction.savepoint_rollback(save_point)
            raise
        else:
            if options.get('dry_run'):
                self.stdout.write("\n\n")
                self.error("Dry run: rollback all changes")
                transaction.savepoint_rollback(save_point)
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/management/commands/iaas2openstack.py/Command.handle/original