def switch_desc_to_dict(desc):
 r = {}
 for k in ['mfr_desc', 'hw_desc', 'sw_desc', 'serial_num', 'dp_desc']:
  r[k] = getattr(desc, k)
 return r

def switch_desc_to_dict ( desc ) : r = { } for k in [ 'mfr_desc' , 'hw_desc' , 'sw_desc' , 'serial_num' , 'dp_desc' ] : r [ k ] = getattr ( desc , k ) return r
takes ofp_desc_stats response .