'Deletes an existing metadata.'

@extensions.expected_errors((404, 409))
@wsgi.response(204)
def delete(self, req, server_id, id):

    context = req.environ['nova.context']
    context.can((sm_policies.POLICY_ROOT % 'delete'))
    metadata = self._get_metadata(context, server_id)
    if (id not in metadata):
        msg = _('Metadata    item    was    not    found')
        raise exc.HTTPNotFound(explanation=msg)
    server = common.get_instance(self.compute_api, context, server_id)
    try:
        self.compute_api.delete_instance_metadata(context, server, id)
    except exception.InstanceUnknownCell as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    except exception.InstanceIsLocked as e:
        raise exc.HTTPConflict(explanation=e.format_message())
    except exception.InstanceInvalidState as state_error:
        common.raise_http_conflict_for_instance_invalid_state(state_error, 'delete    metadata', server_id)
