The exception raised when detaching LUN.
The auto zone is enabled.
The root cause is that the LUN is the last LUN attached to the host. After detaching it, the `host.host_luns` is None.
To fix this issue, add None check.
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils Traceback (most recent call last):
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/powervc_cinder/zonemanager/powervc_utils.py", line 570, in decorator
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils info = terminate_connection(self, *args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/driver.py", line 166, in terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils return self.adapter.terminate_connection(volume, connector)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 883, in trace_logging_wrapper
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils result = f(*args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/adapter.py", line 317, in terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils return self._terminate_connection(lun, connector)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/utils.py", line 883, in trace_logging_wrapper
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils result = f(*args, **kwargs)
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/dell_emc/unity/adapter.py", line 746, in _terminate_connection
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils if len(host.host_luns) == 0:
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils TypeError: object of type 'NoneType' has no len()
2018-03-26 09:29:31.595 55283 ERROR powervc_cinder.zonemanager.powervc_utils
Fix proposed to branch: master /review. openstack. org/556803
Review: https:/