Merge pull request #19921 from thatch45/The-Loeki-fix_sysctl

Merge #19838
This commit is contained in:
Thomas S Hatch 2015-01-21 12:47:11 -07:00
commit 5bd3ad8f76

View File

@ -13,6 +13,7 @@ import salt.utils
from salt._compat import string_types
from salt.exceptions import CommandExecutionError
from salt.modules.systemd import _sd_booted
import string
log = logging.getLogger(__name__)
@ -132,7 +133,7 @@ def assign(name, value):
salt '*' sysctl.assign net.ipv4.ip_forward 1
'''
value = str(value)
sysctl_file = '/proc/sys/{0}'.format(name.replace('.', '/'))
sysctl_file = '/proc/sys/{0}'.format(name.translate(string.maketrans('./', '/.')))
if not os.path.exists(sysctl_file):
raise CommandExecutionError('sysctl {0} does not exist'.format(name))