parameters: (self, service_map)
return_statement: return osd_map
docstring: Create an osd map
docstring_summary: Create an osd map
docstring_tokens: Create an osd map
function: def fetch_osd_map(self, service_map):
          """Create an osd map"""
          stats = self.mgr.get('osd_stats')
  
          osd_map = dict()
  
          devices = self.mgr.get('osd_map_crush')['devices']
          for dev in devices:
              osd_id = str(dev['id']) 
              osd_map[osd_id] = dict(
                  deviceclass=dev.get('class'),
                  capacity=0,
                  hostname=service_map['osd', osd_id]
                  )
          
          for osd_stat in stats['osd_stats']:
              osd_id = str(osd_stat.get('osd'))
              osd_map[osd_id]['capacity'] = osd_stat['statfs']['total']
  
          return osd_map
function_tokens: def fetch_osd_map ( self , service_map ) : stats = self . mgr . get ( 'osd_stats' ) osd_map = dict ( ) devices = self . mgr . get ( 'osd_map_crush' ) [ 'devices' ] for dev in devices : osd_id = str ( dev [ 'id' ] ) osd_map [ osd_id ] = dict ( deviceclass = dev . get ( 'class' ) , capacity = 0 , hostname = service_map [ 'osd' , osd_id ] ) for osd_stat in stats [ 'osd_stats' ] : osd_id = str ( osd_stat . get ( 'osd' ) ) osd_map [ osd_id ] [ 'capacity' ] = osd_stat [ 'statfs' ] [ 'total' ] return osd_map