diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-23 15:32:51 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-02-23 15:32:51 +0100 |
commit | f4e60d02df629f903fc677ad519fecc3f2e2b7be (patch) | |
tree | 314508ae5e9222e9daf75ba744d114fc76b09b5b /src/conf_mode/snmp.py | |
parent | 373fcb829e95b52c6edd5fafd087012988d66c07 (diff) | |
parent | 9621e4b7552df43876f153db1d1156ad8c4ba72c (diff) | |
download | vyos-1x-f4e60d02df629f903fc677ad519fecc3f2e2b7be.tar.gz vyos-1x-f4e60d02df629f903fc677ad519fecc3f2e2b7be.zip |
Merge branch 'pppoe-rewrite' of https://github.com/c-po/vyos-1x into current
* 'pppoe-rewrite' of https://github.com/c-po/vyos-1x: (23 commits)
pppoe: T2055: do not try to start a deleted dialer interface
pppoe: T1318: declutter name-server CLI nodes
pppoe: T2055: remove router-advert node in client interface
pppoe: T1318: migrate user-id and password nodes under an authentication node
pppoe: T1318: rename link to source-interface
pppoe: T1318: use include files for disable and descriptionx
pppoe: T1318: rephrase help text on default-route
interface-definitions: include: disable: rephrase help text
pppoe: T1318: extend migrator for firewall, qos and ip routing nodes
pppoe: T1318: proper delete old interfaces in migrator
pppoe: T1318: increase priority so PPPoE is run after bond interfaces
pppoe: T1318: fix migrator and add missing link statement
pppoe: T1318: use lists rather then strings on Config()
pppoe: T1318: support interface description
pppoe: T1318: remove obsolete ipv6-up.d script
pppoe: T1318: add op-mode commands for link information
pppoe: T1318: use systemd to manage connection
pppoe: T1318: remove process startup debug output
pppoe: T1318: move process startup to apply()
pppoe: T1318: "link" option is mandatory
...
Diffstat (limited to 'src/conf_mode/snmp.py')
-rwxr-xr-x | src/conf_mode/snmp.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index 7cffa5e04..ac94afb1a 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -710,18 +710,20 @@ def apply(snmp): # Passwords are not available immediately in the configuration file, # after daemon startup - we wait until they have been processed by # snmpd, which we see when a magic line appears in this file. - ready = False - while not ready: + while True: while not os.path.exists(config_file_user): sleep(0.5) - ready = True - with open(config_file_user, 'r') as f: - for line in f: - # Search for our magic string inside the file - if 'usmUser' in line: - ready = True - break + try: + with open(config_file_user, 'r') as f: + for line in f: + # Search for our magic string inside the file + if 'usmUser' in line: + break + except IOError: + continue + else: + break # net-snmp is now regenerating the configuration file in the background # thus we need to re-open and re-read the file as the content changed. |