diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-10-27 23:29:14 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-27 23:57:10 +0100 |
commit | ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209 (patch) | |
tree | 4c688418fc69915e2193d51068c16c80695254d9 | |
parent | 7021b97dad29d2e2509a0f5b7024eb506d04b62b (diff) | |
download | vyos-1x-ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209.tar.gz vyos-1x-ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209.zip |
snmp: use proper stat literals on chmod()
-rwxr-xr-x | src/conf_mode/snmp.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index f796e9978..a8c604bdd 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -27,6 +27,7 @@ import vyos.validate from binascii import hexlify from shutil import move from time import sleep +from stat import S_IRWXU,S_IXGRP,S_IXOTH from vyos.config import Config from vyos import ConfigError @@ -545,9 +546,9 @@ def verify(snmp): if snmp['script_ext']: for ext in snmp['script_ext']: if not os.path.isfile(snmp['script_ext'][ext]): - print ("WARNING: script: " + snmp['script_ext'][ext] + " doesn\'t exist") + print ("WARNING: script: {} doesn't exist".format(snmp['script_ext'][ext])) else: - os.chmod(snmp['script_ext'][ext], 0o555) + os.chmod(snmp['script_ext'][ext], S_IRWXU|S_IXGRP|S_IXOTH) for listen in snmp['listen_address']: addr = listen[0] |