def populate_network_choices(self, request, context): #return instance_utils.network_field_data(request) networkfilter = instance_utils.network_field_data(request) for jordan in networkfilter: projectname = str(request.user.tenant_name).lower() networkid = jordan[0] splitnetworka = str(jordan[1]).split("-") networkname = str(splitnetworka[0]).lower() if networkname in projectname: netlistreturn = [(networkid, str(jordan[1]))] return netlistreturn return instance_utils.network_field_data(request)
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) networks = instance_utils.network_field_data(request, include_empty_option=True) self.fields['network'].choices = networks self.fields['network_type'].choices = [('network', _('Network')), ('port', _('Port'))]
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) instance_id = kwargs.get('initial', {}).get('instance_id') self.fields['instance_id'].initial = instance_id networks = instance_utils.network_field_data(request, include_empty_option=True) self.fields['network'].choices = networks
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) instance_id = kwargs.get('initial', {}).get('instance_id') self.fields['instance_id'].initial = instance_id networks = instance_utils.network_field_data(request, include_empty_option=True) self.fields['network'].choices = networks
def _populate_custom_choices(self, custom_type): if custom_type == 'neutron.network': return instance_utils.network_field_data(self.request, True) if custom_type == 'nova.keypair': return instance_utils.keypair_field_data(self.request, True) if custom_type == 'glance.image': return image_utils.image_field_data(self.request, True) if custom_type == 'nova.flavor': return instance_utils.flavor_field_data(self.request, True) return []
def _populate_custom_choices(self, custom_type): if custom_type == 'neutron.network': return instance_utils.network_field_data(self.request, True) if custom_type == 'nova.keypair': return instance_utils.keypair_field_data(self.request, True) if custom_type == 'glance.image': return image_utils.image_field_data(self.request, True) if custom_type == 'nova.flavor': return instance_utils.flavor_field_data(self.request, True) return []
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) networks = instance_utils.network_field_data(request, include_empty_option=True) self.fields['network'].choices = networks choices = [('network', _('Network'))] ports = instance_utils.port_field_tenant_data(request) if len(ports) > 0: self.fields['port'].choices = ports choices.append(('port', _("Port"))) self.fields['network_type'].choices = choices
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) networks = instance_utils.network_field_data(request, include_empty_option=True, with_cidr=True) self.fields['network'].choices = networks choices = [('network', _("by Network (and IP address)"))] ports = instance_utils.port_field_data(request, with_network=True) if ports: self.fields['port'].choices = ports choices.append(('port', _("by Port"))) self.fields['specification_method'].choices = choices
def __init__(self, request, *args, **kwargs): super(AttachInterface, self).__init__(request, *args, **kwargs) networks = instance_utils.network_field_data(request, include_empty_option=True, with_cidr=True) self.fields['network'].choices = networks choices = [('network', _("by Network (and IP address)"))] ports = instance_utils.port_field_data(request, with_network=True) if len(ports) > 0: self.fields['port'].choices = ports choices.append(('port', _("by Port"))) self.fields['specification_method'].choices = choices
def populate_network_choices(self, request, context): return instance_utils.network_field_data(request)
def populate_network_choices(self, request, context): return instance_utils.network_field_data(request)
def _populate_network_choices(self, include_empty=True): return instance_utils.network_field_data(self.request, include_empty)