mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
networks: Don't re-add settings if they exist
- This is a probable reason why a phantom new connection show up sometimes.
This commit is contained in:
parent
a66275bdf7
commit
21ee2de998
@ -199,21 +199,21 @@ def _update_pppoe_settings(connection, connection_uuid, name, interface, zone,
|
|||||||
settings = connection.get_setting_pppoe()
|
settings = connection.get_setting_pppoe()
|
||||||
if not settings:
|
if not settings:
|
||||||
settings = nm.SettingPppoe.new()
|
settings = nm.SettingPppoe.new()
|
||||||
|
connection.add_setting(settings)
|
||||||
|
|
||||||
settings.set_property(nm.SETTING_PPPOE_USERNAME, username)
|
settings.set_property(nm.SETTING_PPPOE_USERNAME, username)
|
||||||
settings.set_property(nm.SETTING_PPPOE_PASSWORD, password)
|
settings.set_property(nm.SETTING_PPPOE_PASSWORD, password)
|
||||||
connection.add_setting(settings)
|
|
||||||
|
|
||||||
settings = connection.get_setting_ppp()
|
settings = connection.get_setting_ppp()
|
||||||
if not settings:
|
if not settings:
|
||||||
settings = nm.SettingPpp.new()
|
settings = nm.SettingPpp.new()
|
||||||
|
connection.add_setting(settings)
|
||||||
|
|
||||||
#ToDo: make this configurable?
|
#ToDo: make this configurable?
|
||||||
#ToDo: apt-get install ppp pppoe
|
#ToDo: apt-get install ppp pppoe
|
||||||
settings.set_property(nm.SETTING_PPP_LCP_ECHO_FAILURE, 5)
|
settings.set_property(nm.SETTING_PPP_LCP_ECHO_FAILURE, 5)
|
||||||
settings.set_property(nm.SETTING_PPP_LCP_ECHO_INTERVAL, 30)
|
settings.set_property(nm.SETTING_PPP_LCP_ECHO_INTERVAL, 30)
|
||||||
|
|
||||||
connection.add_setting(settings)
|
|
||||||
return connection
|
return connection
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user