From aa0b5251fa2e9c4b652582f747c2df0b34a3f66a Mon Sep 17 00:00:00 2001
From: Christian Poessinger <christian@poessinger.com>
Date: Sat, 7 Mar 2020 18:09:38 +0100
Subject: pppoe: T1493: rename variables on ipv6-up script

---
 src/conf_mode/interfaces-pppoe.py | 13 +++++++------
 1 file 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
 
-- 
cgit v1.2.3