Comment 1 for bug 1261894

Revision history for this message
Ron Rickard (rjrjr) wrote :

In designate/storage/api.py, we have:

@contextlib.contextmanager
    def delete_record(self, context, record_id):
        """
Delete a record

:param context: RPC Context
:param record_id: Record ID to delete
"""
        yield self.storage.get_record(context, record_id)
        self.storage.delete_record(context, record_id)

If we change this to:

@contextlib.contextmanager
    def delete_record(self, context, record_id):
        """
Delete a record

:param context: RPC Context
:param record_id: Record ID to delete
"""
        record = self.storage.get_record(context, record_id)
        self.storage.delete_record(context, record_id)
        yield record

On the surface, it fixes the BIND 9 driver and we can delete records successfully. I'm guessing this is not desired however. Am I correct about this?

The real issue here is how the backend BIND 9 driver works. The code as written gets the record, passes the record to the backend, and the backend should do something with that record. With the BIND 9 driver, it doesn't do anything with the record, but constructs a new zone file and reloads it. Then the record is delete from the central storage. Unfortunately, the record was present during the zone file creation, hence the record is not being deleted.