From 932d2e17f9f4983afaa82ab1640a9353aeff0b6b Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Tue, 28 Jan 2020 17:43:43 +0200 Subject: [PATCH] networks: Support virtual Ethernet (veth) devices Closes #1767 Signed-off-by: Veiko Aasa [sunil: Add comment and a cosmetic change] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- plinth/modules/networks/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plinth/modules/networks/forms.py b/plinth/modules/networks/forms.py index 106645e3c..0b0a43aae 100644 --- a/plinth/modules/networks/forms.py +++ b/plinth/modules/networks/forms.py @@ -43,7 +43,7 @@ class ConnectionForm(forms.Form): """Base form to create/edit a connection.""" name = forms.CharField(label=_('Connection Name')) interface = forms.ChoiceField( - label=_('Physical Interface'), choices=(), + label=_('Network Interface'), choices=(), help_text=_('The network device that this connection should be bound ' 'to.')) zone = forms.ChoiceField( @@ -120,6 +120,10 @@ class ConnectionForm(forms.Form): def _get_interface_choices(device_type): """Return a list of choices for a given device type.""" interfaces = network.get_interface_list(device_type) + # Support for virtual Ethernet devices used in containers + if device_type == nm.DeviceType.ETHERNET: + interfaces.update(network.get_interface_list(nm.DeviceType.VETH)) + choices = [('', _('-- select --'))] for interface, mac in interfaces.items(): display_string = '{interface} ({mac})'.format(