discovery rescan_hosts fails with the below KeyError
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager [req-b2c098c1-9476-4c29-893e-7def556b9996 0688b01e6439ca32d698d20789d52169126fb41fb1a4ddafcebb97d854e836c9 adc5626d929449ed8c43aa5f830a2942 - default default] Failed to copy volume 0f5136a4-a40b-45ac-bd4d-4842ca90a416 to 3d2278fe-a26a-49c4-87b3-d44e5b3c64ab: KeyError: 'target_wwn'
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager Traceback (most recent call last):
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 2079, in _migrate_volume_generic
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager self._copy_volume_data(ctxt, volume, new_volume, remote='dest')
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 1975, in _copy_volume_data
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager force=True)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager self.force_reraise()
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager six.reraise(self.type_, self.value, self.tb)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 1968, in _copy_volume_data
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager attach_encryptor=attach_encryptor)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 1895, in _attach_volume
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager attach_info = self._connect_device(conn)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 1859, in _connect_device
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager vol_handle = connector.connect_volume(conn['data'])
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/os_brick/utils.py", line 137, in trace_logging_wrapper
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager return f(*args, **kwargs)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager return f(*args, **kwargs)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/os_brick/initiator/connectors/fibre_channel.py", line 170, in connect_volume
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager timer.start(interval=2).wait()
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/eventlet/event.py", line 121, in wait
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager return hubs.get_hub().switch()
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 294, in switch
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager return self.greenlet.switch()
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/oslo_service/loopingcall.py", line 144, in _run_loop
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager result = func(*self.args, **self.kw)
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/os_brick/initiator/connectors/fibre_channel.py", line 162, in _wait_for_device_discovery
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager connection_properties['target_lun'])
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager File "/usr/lib/python2.7/site-packages/os_brick/initiator/linuxfc.py", line 297, in rescan_hosts
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager for wwpn in hba['target_wwn']:
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager KeyError: 'target_wwn'
2017-09-21 09:52:09.016 30851 ERROR cinder.volume.manager
Fix proposed to branch: master /review. openstack. org/506578
Review: https:/