'Return subset of cell information for OS API use.'

def get_cell_info(self):

    db_fields_to_return = ['is_parent', 'weight_scale', 'weight_offset']
    url_fields_to_return = {'username': 'username', 'hostname': 'rpc_host', 'port': 'rpc_port'}
    cell_info = dict(name=self.name, capabilities=self.capabilities)
    if self.db_info:
        for field in db_fields_to_return:
            cell_info[field] = self.db_info[field]
        url = rpc.get_transport_url(self.db_info['transport_url'])
        if url.hosts:
            for (field, canonical) in url_fields_to_return.items():
                cell_info[canonical] = getattr(url.hosts[0], field)
    return cell_info
