From f7d00a91e42d668bb23a63673b4e1b36d8e319ef Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 21 Feb 2020 19:55:15 +0100 Subject: pppoe: T1318: fix migrator and add missing link statement --- src/migration-scripts/interfaces/4-to-5 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/migration-scripts/interfaces/4-to-5') diff --git a/src/migration-scripts/interfaces/4-to-5 b/src/migration-scripts/interfaces/4-to-5 index a8f9addcf..15d841e89 100755 --- a/src/migration-scripts/interfaces/4-to-5 +++ b/src/migration-scripts/interfaces/4-to-5 @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -# Change syntax of wireless interfaces +# De-nest PPPoE interfaces # Migrate boolean nodes to valueless -from sys import exit +import sys from vyos.configtree import ConfigTree def migrate_dialer(config, tree, intf): @@ -14,8 +14,10 @@ def migrate_dialer(config, tree, intf): # format as tag node to avoid loading problems config.set_tag(['interfaces', 'pppoe']) + # We need to assign a real interface to our dialer + config.set(new_base + ['link'], value=intf) + default_route = tree + [pppoe, 'default-route'] - print(default_route) if config.exists(default_route): tmp = config.return_value(default_route) config.set(new_base + ['default-route'], value=tmp) @@ -93,13 +95,9 @@ if __name__ == '__main__': intf = "{}.{}".format(interface, vlan) migrate_dialer(config, pppoe_if, intf) - - print(config.to_string()) - exit(1) - try: with open(file_name, 'w') as f: f.write(config.to_string()) except OSError as e: print("Failed to save the modified config: {}".format(e)) - exit(1) + sys.exit(1) -- cgit v1.2.3