def _get_class(pid): prov_type = self.appliance.rest_api.collections.providers.get(id=pid)['type'] for prov_class in provider_types('infra').values(): if prov_class.db_types[0] in prov_type: return prov_class