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)
......
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' ) 'cinder. context' ]
self.authorize (context, 'force_detach')
connector = body['os- force_detach' ].get(' connector' , None) HTTPBadRequest(
explanation= _("Must specify 'connector'."))
self. volume_ api.terminate_ connection( context, volume, connector) VolumeBackendAP IException as error: HTTPInternalSer verError( explanation= msg)
def _force_detach(self, req, id, body):
"""Roll back a bad detach after the volume been disconnected."""
context = req.environ[
# Not found exception will be handled at the wsgi level
volume = self._get(context, id)
try:
except KeyError:
raise webob.exc.
try:
except exception.
msg = _("Unable to terminate volume connection from backend.")
raise webob.exc.
......