summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pppoe.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-07 18:09:38 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-07 18:17:54 +0100
commitaa0b5251fa2e9c4b652582f747c2df0b34a3f66a (patch)
treeb135ef4193ba64515f24c722b9535c8d4664823b /src/conf_mode/interfaces-pppoe.py
parentac45a7ee1d48b6988b9e5ccb9ee0883c5177a5e7 (diff)
downloadvyos-1x-aa0b5251fa2e9c4b652582f747c2df0b34a3f66a.tar.gz
vyos-1x-aa0b5251fa2e9c4b652582f747c2df0b34a3f66a.zip
pppoe: T1493: rename variables on ipv6-up script
Diffstat (limited to 'src/conf_mode/interfaces-pppoe.py')
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index 0b7d8e9cb..46a6171c6 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -277,7 +277,7 @@ def verify(pppoe):
def generate(pppoe):
config_file_pppoe = '/etc/ppp/peers/{}'.format(pppoe['intf'])
- ipv6_ifup_script_file = '/etc/ppp/ipv6-up.d/50-vyos-{}-autoconf'.format(pppoe['intf'])
+ ipv6_if_up_script_file = '/etc/ppp/ipv6-up.d/50-vyos-{}-autoconf'.format(pppoe['intf'])
# Always hang-up PPPoE connection prior generating new configuration file
cmd = 'systemctl stop ppp@{}.service'.format(pppoe['intf'])
@@ -288,8 +288,8 @@ def generate(pppoe):
if os.path.exists(config_file_pppoe):
os.unlink(config_file_pppoe)
- if os.path.exists(ipv6_ifup_script_file):
- os.unlink(ipv6_ifup_script_file)
+ if os.path.exists(ipv6_if_up_script_file):
+ os.unlink(ipv6_if_up_script_file)
else:
# Create PPP configuration files
@@ -298,13 +298,14 @@ def generate(pppoe):
with open(config_file_pppoe, 'w') as f:
f.write(config_text)
- script_file = '/etc/ppp/ipv6-up.d/50-vyos-{}-autoconf'.format(pppoe['intf'])
tmpl = Template(config_pppoe_ipv6_up_tmpl)
config_text = tmpl.render(pppoe)
- with open(ipv6_ifup_script_file, 'w') as f:
+ with open(ipv6_if_up_script_file, 'w') as f:
f.write(config_text)
- os.chmod(script_file, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
+ bitmask = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | \
+ S_IROTH | S_IXOTH
+ os.chmod(ipv6_if_up_script_file, bitmask)
return None