def populate_network_choices(self, request, context):
    try:
        tenant_id = self.request.user.tenant_id
        networks = dash_api.neutron.network_list_for_tenant(request, tenant_id)
        network_list = [(network.id, network.name_or_id) for network in networks]
    except Exception:
        network_list = []
        exceptions.handle(request, _('Unable to retrieve networks.'))
    return network_list
def populate_network_choices(self, request, context):
    try:
        tenant_id = self.request.user.tenant_id
        networks = dash_api.neutron.network_list_for_tenant(request, tenant_id)
        network_list = [(network.id, network.name_or_id) for network in networks]
    except Exception:
        network_list = []
        exceptions.handle(request, _('Unable to retrieve networks.'))
    return network_list