def execute_task(self): log.debug(u"DeleteMapping for notification %s" % self._notification) processor_id = self.get_processor_id() # If we couldn't find processor_id, keep message and we'll retry message later. if not processor_id: return [] # Delete the route. processor = DNSProcessor(None, self._table, self._notification.region) try: delete_notification = processor.remove_instance_mapping(processor_id, self._notification.instance_id) except ValueError: log.exception("Invalid mapping to remove") delete_notification = True # Delete our notification if delete_notification: self._notification.delete()
def execute_task(self): log.debug(u"DeleteMapping for notification %s" % self._notification) processor_id = self.get_processor_id() # If we couldn't find processor_id, keep message and we'll retry message later. if not processor_id: return [] # Delete the route. processor = DNSProcessor(None, self._table, self._notification.region) try: delete_notification = processor.remove_instance_mapping( processor_id, self._notification.instance_id) except ValueError: log.exception("Invalid mapping to remove") delete_notification = True # Delete our notification if delete_notification: self._notification.delete()