From ebcb19b5b9a1ae57b3b0f902d6fb0259fe2ed209 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 27 Oct 2019 23:29:14 +0100 Subject: snmp: use proper stat literals on chmod() --- src/conf_mode/snmp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/snmp.py') 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] -- cgit v1.2.3