diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-01-03 15:37:28 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-01-03 15:38:28 +0100 |
commit | 2d6be4238e3c46ae84e8b44cad9e3d60600a882c (patch) | |
tree | 0915e355ee43e6e4eb4ec28058d5160747e19f2d /src/conf_mode/snmp.py | |
parent | 77d7e727faa5725735fd2b7742722a3f7f71d52f (diff) | |
download | vyos-1x-2d6be4238e3c46ae84e8b44cad9e3d60600a882c.tar.gz vyos-1x-2d6be4238e3c46ae84e8b44cad9e3d60600a882c.zip |
T1147: Fix SNMP config file generation on newly installed systems
(cherry picked from commit 59471ed0c249771fa6c46cf0b020222b7caeee42)
Diffstat (limited to 'src/conf_mode/snmp.py')
-rwxr-xr-x | src/conf_mode/snmp.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index 026f6d2f7..d21a2b603 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -21,6 +21,7 @@ import os import shutil import stat import pwd +import time import jinja2 import random @@ -793,6 +794,9 @@ def apply(snmp): # snmpd, which we see when a magic line appears in this file. snmpReady = False while not snmpReady: + while not os.path.exists(config_file_user): + time.sleep(1) + with open(config_file_user, 'r') as f: for line in f: # Search for our magic string inside the file |