def _get_vol_bdm_attachment_info(self, bdm):
        drv_vol_bdm = driver_block_device.convert_volume(bdm)
        if not drv_vol_bdm:
            return

        connection_info = drv_vol_bdm['connection_info']
        if not connection_info:
            LOG.warning("Missing connection info for volume %s.",
                        bdm.volume_id)
            return

        attachment_info = self._volops.get_disk_attachment_info(
            connection_info)
        attachment_info['serial'] = connection_info['serial']
        return attachment_info
Ejemplo n.º 2
0
 def test_convert_volume(self):
     self.assertIsNone(driver_block_device.convert_volume(self.swap_bdm))
     self.assertEqual(self.volume_driver_bdm,
                      driver_block_device.convert_volume(self.volume_bdm))
     self.assertEqual(self.snapshot_driver_bdm,
                      driver_block_device.convert_volume(self.snapshot_bdm))
 def test_convert_volume(self):
     self.assertIsNone(driver_block_device.convert_volume(self.swap_bdm))
     self.assertEqual(self.volume_driver_bdm,
                      driver_block_device.convert_volume(self.volume_bdm))
     self.assertEqual(self.snapshot_driver_bdm,
                      driver_block_device.convert_volume(self.snapshot_bdm))