parameters: (lvs, lv_tags={})
return_statement: return list(set(verified_devices))
docstring: Go through each LV and ensure if backing devices (journal, wal, block)
      are LVs or partitions, so that they can be accurately reported.
docstring_summary: Go through each LV and ensure if backing devices (journal, wal, block)
      are LVs or partitions, so that they can be accurately reported.
docstring_tokens: Go through each LV and ensure if backing devices ( journal wal block ) are LVs or partitions so that they can be accurately reported .
function: def ensure_associated_lvs(lvs, lv_tags={}):
      """
      Go through each LV and ensure if backing devices (journal, wal, block)
      are LVs or partitions, so that they can be accurately reported.
      """
      # look for many LVs for each backing type, because it is possible to
      # receive a filtering for osd.1, and have multiple failed deployments
      # leaving many journals with osd.1 - usually, only a single LV will be
      # returned
  
      journal_lvs = api.get_lvs(tags=merge_dict(lv_tags, {'ceph.type': 'journal'}))
      db_lvs = api.get_lvs(tags=merge_dict(lv_tags, {'ceph.type': 'db'}))
      wal_lvs = api.get_lvs(tags=merge_dict(lv_tags, {'ceph.type': 'wal'}))
      backing_devices = [(journal_lvs, 'journal'), (db_lvs, 'db'),
                         (wal_lvs, 'wal')]
  
      verified_devices = []
  
      for lv in lvs:
          # go through each lv and append it, otherwise query `blkid` to find
          # a physical device. Do this for each type (journal,db,wal) regardless
          # if they have been processed in the previous LV, so that bad devices
          # with the same ID can be caught
          for ceph_lvs, _type in backing_devices:
              if ceph_lvs:
                  verified_devices.extend([l.lv_path for l in ceph_lvs])
                  continue
  
              # must be a disk partition, by querying blkid by the uuid we are
              # ensuring that the device path is always correct
              try:
                  device_uuid = lv.tags['ceph.%s_uuid' % _type]
              except KeyError:
                  # Bluestore will not have ceph.journal_uuid, and Filestore
                  # will not not have ceph.db_uuid
                  continue
  
              osd_device = disk.get_device_from_partuuid(device_uuid)
              if not osd_device:
                  # if the osd_device is not found by the partuuid, then it is
                  # not possible to ensure this device exists anymore, so skip it
                  continue
              verified_devices.append(osd_device)
  
          verified_devices.append(lv.lv_path)
  
      # reduce the list from all the duplicates that were added
      return list(set(verified_devices))
function_tokens: def ensure_associated_lvs ( lvs , lv_tags = { } ) : # look for many LVs for each backing type, because it is possible to # receive a filtering for osd.1, and have multiple failed deployments # leaving many journals with osd.1 - usually, only a single LV will be # returned journal_lvs = api . get_lvs ( tags = merge_dict ( lv_tags , { 'ceph.type' : 'journal' } ) ) db_lvs = api . get_lvs ( tags = merge_dict ( lv_tags , { 'ceph.type' : 'db' } ) ) wal_lvs = api . get_lvs ( tags = merge_dict ( lv_tags , { 'ceph.type' : 'wal' } ) ) backing_devices = [ ( journal_lvs , 'journal' ) , ( db_lvs , 'db' ) , ( wal_lvs , 'wal' ) ] verified_devices = [ ] for lv in lvs : # go through each lv and append it, otherwise query `blkid` to find # a physical device. Do this for each type (journal,db,wal) regardless # if they have been processed in the previous LV, so that bad devices # with the same ID can be caught for ceph_lvs , _type in backing_devices : if ceph_lvs : verified_devices . extend ( [ l . lv_path for l in ceph_lvs ] ) continue # must be a disk partition, by querying blkid by the uuid we are # ensuring that the device path is always correct try : device_uuid = lv . tags [ 'ceph.%s_uuid' % _type ] except KeyError : # Bluestore will not have ceph.journal_uuid, and Filestore # will not not have ceph.db_uuid continue osd_device = disk . get_device_from_partuuid ( device_uuid ) if not osd_device : # if the osd_device is not found by the partuuid, then it is # not possible to ensure this device exists anymore, so skip it continue verified_devices . append ( osd_device ) verified_devices . append ( lv . lv_path ) # reduce the list from all the duplicates that were added return list ( set ( verified_devices ) )