Comment 1 for bug 1686278

Revision history for this message
Jeremy Zhang (jeremy.zhang) wrote :

    Codes below is in cinder/api/contrib/admin_actions.py. That we can find that the connector can be set to None. Here I think /cinder/cinder/volume/drivers/dell_emc/vnx/driver.py should handle the scenario when connector is None.

    @wsgi.action('os-force_detach')
    def _force_detach(self, req, id, body):
        """Roll back a bad detach after the volume been disconnected."""
        context = req.environ['cinder.context']
        self.authorize(context, 'force_detach')
        # Not found exception will be handled at the wsgi level
        volume = self._get(context, id)
        try:
            connector = body['os-force_detach'].get('connector', None)
        except KeyError:
            raise webob.exc.HTTPBadRequest(
                explanation=_("Must specify 'connector'."))
        try:
            self.volume_api.terminate_connection(context, volume, connector)
        except exception.VolumeBackendAPIException as error:
            msg = _("Unable to terminate volume connection from backend.")
            raise webob.exc.HTTPInternalServerError(explanation=msg)
     ......