summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-01-26 17:24:55 +0000
committerGerrit Code Review <review@openstack.org>2017-01-26 17:24:55 +0000
commit2e1118149b39467d82c3b53b764a5351354c543c (patch)
treeb10f4b6cc8d6e52dc97b441e81c545eb11318dc9
parent763d5dd4b35278d59f5666d8684a00ab94aa2989 (diff)
parent2f5a2585827a281f086c8a94e1da497e0821f701 (diff)
Merge "Fix issues on create network and create port modals"11.0.0.0b3
-rw-r--r--openstack_dashboard/dashboards/admin/networks/forms.py9
-rw-r--r--openstack_dashboard/dashboards/admin/networks/ports/forms.py4
-rw-r--r--openstack_dashboard/dashboards/project/networks/forms.py4
-rw-r--r--openstack_dashboard/dashboards/project/networks/ports/forms.py4
4 files changed, 11 insertions, 10 deletions
diff --git a/openstack_dashboard/dashboards/admin/networks/forms.py b/openstack_dashboard/dashboards/admin/networks/forms.py
index 41774a7..e57575e 100644
--- a/openstack_dashboard/dashboards/admin/networks/forms.py
+++ b/openstack_dashboard/dashboards/admin/networks/forms.py
@@ -126,8 +126,8 @@ class CreateNetwork(forms.SelfHandlingForm):
126 'data-switch-on': 'network_type', 126 'data-switch-on': 'network_type',
127 })) 127 }))
128 admin_state = forms.ThemableChoiceField( 128 admin_state = forms.ThemableChoiceField(
129 choices=[(True, _('UP')), 129 choices=[('True', _('UP')),
130 (False, _('DOWN'))], 130 ('False', _('DOWN'))],
131 label=_("Admin State")) 131 label=_("Admin State"))
132 shared = forms.BooleanField(label=_("Shared"), 132 shared = forms.BooleanField(label=_("Shared"),
133 initial=False, required=False) 133 initial=False, required=False)
@@ -288,9 +288,10 @@ class CreateNetwork(forms.SelfHandlingForm):
288 def _clean_segmentation_id(self, data): 288 def _clean_segmentation_id(self, data):
289 network_type = data.get('network_type') 289 network_type = data.get('network_type')
290 if 'segmentation_id' in self._errors: 290 if 'segmentation_id' in self._errors:
291 if network_type not in self.nettypes_with_seg_id: 291 if (network_type not in self.nettypes_with_seg_id and
292 not self.data.get("segmentation_id")):
292 # In this case the segmentation ID is not required, so we can 293 # In this case the segmentation ID is not required, so we can
293 # ignore any errors. 294 # ignore the field is required error.
294 del self._errors['segmentation_id'] 295 del self._errors['segmentation_id']
295 elif network_type in self.nettypes_with_seg_id: 296 elif network_type in self.nettypes_with_seg_id:
296 seg_id = data.get('segmentation_id') 297 seg_id = data.get('segmentation_id')
diff --git a/openstack_dashboard/dashboards/admin/networks/ports/forms.py b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
index d60d1c9..521f37a 100644
--- a/openstack_dashboard/dashboards/admin/networks/ports/forms.py
+++ b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
@@ -43,8 +43,8 @@ class CreatePort(forms.SelfHandlingForm):
43 name = forms.CharField(max_length=255, 43 name = forms.CharField(max_length=255,
44 label=_("Name"), 44 label=_("Name"),
45 required=False) 45 required=False)
46 admin_state = forms.ThemableChoiceField(choices=[(True, _('UP')), 46 admin_state = forms.ThemableChoiceField(choices=[('True', _('UP')),
47 (False, _('DOWN'))], 47 ('False', _('DOWN'))],
48 label=_("Admin State")) 48 label=_("Admin State"))
49 device_id = forms.CharField(max_length=100, label=_("Device ID"), 49 device_id = forms.CharField(max_length=100, label=_("Device ID"),
50 help_text=_("Device ID attached to the port"), 50 help_text=_("Device ID attached to the port"),
diff --git a/openstack_dashboard/dashboards/project/networks/forms.py b/openstack_dashboard/dashboards/project/networks/forms.py
index da4fcbc..767f37d 100644
--- a/openstack_dashboard/dashboards/project/networks/forms.py
+++ b/openstack_dashboard/dashboards/project/networks/forms.py
@@ -39,8 +39,8 @@ class UpdateNetwork(forms.SelfHandlingForm):
39 widget=forms.TextInput( 39 widget=forms.TextInput(
40 attrs={'readonly': 'readonly'})) 40 attrs={'readonly': 'readonly'}))
41 admin_state = forms.ThemableChoiceField( 41 admin_state = forms.ThemableChoiceField(
42 choices=[(True, _('UP')), 42 choices=[('True', _('UP')),
43 (False, _('DOWN'))], 43 ('False', _('DOWN'))],
44 required=False, 44 required=False,
45 label=_("Admin State")) 45 label=_("Admin State"))
46 shared = forms.BooleanField(label=_("Shared"), required=False) 46 shared = forms.BooleanField(label=_("Shared"), required=False)
diff --git a/openstack_dashboard/dashboards/project/networks/ports/forms.py b/openstack_dashboard/dashboards/project/networks/ports/forms.py
index e907ccd..f373ab4 100644
--- a/openstack_dashboard/dashboards/project/networks/ports/forms.py
+++ b/openstack_dashboard/dashboards/project/networks/ports/forms.py
@@ -39,8 +39,8 @@ class UpdatePort(forms.SelfHandlingForm):
39 label=_("Name"), 39 label=_("Name"),
40 required=False) 40 required=False)
41 admin_state = forms.ThemableChoiceField( 41 admin_state = forms.ThemableChoiceField(
42 choices=[(True, _('UP')), 42 choices=[('True', _('UP')),
43 (False, _('DOWN'))], 43 ('False', _('DOWN'))],
44 label=_("Admin State")) 44 label=_("Admin State"))
45 failure_url = 'horizon:project:networks:detail' 45 failure_url = 'horizon:project:networks:detail'
46 46