Added a new network connection type to handle PPPoE connections

* Added a new choice to main selectbox for adding Network Connections (network.py)
* Added a new form which asks for name, interface, firewall zone, username and password (forms.py, urls.py)
* Added new helper functions to create PPPoE based connection object (network.py)
This commit is contained in:
Daniel Steglich authored and Sunil Mohan Adapa committed 2015-08-22 13:03:00 +05:30
1 parent 2879c9cedb
commit 286caf8917
4 files changed
+131 -4

No files matched your search

+23
View File
@@ -73,6 +73,29 @@ available over this interfaces. Select Internal only for trusted networks.'),
self.fields['interface'].choices = choices
class AddPPPoEForm(forms.Form):
"""Form to create a new pppoe connection."""
name = forms.CharField(label=_('Connection Name'))
interface = forms.ChoiceField(
label=_('Physical Interface'),
choices=(),
help_text=_('The network device that this connection should be bound '
'to.'))
zone = forms.ChoiceField(
label=_('Firewall Zone'),
help_text=_('The firewall zone will control which services are \
available over this interfaces. Select Internal only for trusted networks.'),
choices=[('external', 'External'), ('internal', 'Internal')])
username = forms.CharField(label=_('Username'))
password = forms.CharField(label=_('Password'))
def __init__(self, *args, **kwargs):
"""Initialize the form, populate interface choices."""
super(AddPPPoEForm, self).__init__(*args, **kwargs)
choices = _get_interface_choices(nm.DeviceType.ETHERNET)
self.fields['interface'].choices = choices
class AddWifiForm(forms.Form):
"""Form to create a new wifi connection."""
name = forms.CharField(label=_('Connection Name'))