From 29637dcf6ecdfba58a7255697a75096d932bc9bc Mon Sep 17 00:00:00 2001 From: Patrick Bonnell Date: Fri, 21 Sep 2018 10:24:53 -0400 Subject: [PATCH] Platform interface no longer requires networks This commit prevents the interface class from being set to None once all the networks have been removed from the platform interface. The interface class will remain to be platform until changed. Closes-Bug: 1793779 Change-Id: Ie1ec201fa0f953831a83077244b452bb0dbd0791 Signed-off-by: Patrick Bonnell --- .../dashboards/admin/inventory/interfaces/forms.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py index d3b68d08..2c597977 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py @@ -484,16 +484,10 @@ class AddInterface(forms.SelfHandlingForm): def clean(self): cleaned_data = super(AddInterface, self).clean() ifclass = cleaned_data.get('ifclass', 'none') - networks = cleaned_data.get('networks', []) if ifclass != 'platform': cleaned_data['networks'] = [] - if ifclass == 'platform' and not networks: - raise forms.ValidationError(_( - "You must assign a network when " - "creating a platform interface.")) - if ifclass != 'data': cleaned_data.pop('ipv4_mode', None) cleaned_data.pop('ipv6_mode', None)