'A task to delete the resource.
Subclasses should provide a handle_delete() method to customise
deletion.'

@scheduler.wrappertask
def delete(self):

    @excutils.exception_filter
    def should_retry(exc):
        if (count >= retry_limit):
            return False
        if self.default_client_name:
            return (self.client_plugin().is_conflict(exc) or isinstance(exc, exception.PhysicalResourceExists))
        return isinstance(exc, exception.PhysicalResourceExists)
    action = self.DELETE
    if ((self.action, self.status) == (self.DELETE, self.COMPLETE)):
        return
    if (self.action == self.INIT):
        return
    initial_state = self.state
    if (self.stack.action == self.stack.DELETE):
        (yield self._break_if_required(self.DELETE, environment.HOOK_PRE_DELETE))
    LOG.info('deleting    %s', self)
    if (self._stored_properties_data is not None):
        self.properties = self.frozen_definition().properties(self.properties_schema, self.context)
        self.translate_properties(self.properties)
    with self._action_recorder(action):
        if self.abandon_in_progress:
            deletion_policy = self.t.RETAIN
        else:
            deletion_policy = self.t.deletion_policy()
        if (deletion_policy != self.t.RETAIN):
            if (deletion_policy == self.t.SNAPSHOT):
                action_args = [[initial_state], 'snapshot']
            else:
                action_args = []
            count = (-1)
            retry_limit = max(cfg.CONF.action_retry_limit, 0)
            while True:
                count += 1
                LOG.info(('delete    %(name)s    attempt    %(attempt)d' % {'name': six.text_type(self), 'attempt': (count + 1)}))
                if count:
                    delay = timeutils.retry_backoff_delay(count, jitter_max=2.0)
                    waiter = scheduler.TaskRunner(self.pause)
                    (yield waiter.as_task(timeout=delay))
                with excutils.exception_filter(should_retry):
                    (yield self.action_handler_task(action, *action_args))
                    break
    if (self.stack.action == self.stack.DELETE):
        (yield self._break_if_required(self.DELETE, environment.HOOK_POST_DELETE))
