diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-21 19:55:15 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-02-23 14:36:56 +0100 |
commit | f7d00a91e42d668bb23a63673b4e1b36d8e319ef (patch) | |
tree | 3d4d7e6ac3ec410bff7f2e6ff70db35e10dd5725 /src/migration-scripts/interfaces/4-to-5 | |
parent | 08c37cd40c65ddb2ecc8eed13df59ef11129622c (diff) | |
download | vyos-1x-f7d00a91e42d668bb23a63673b4e1b36d8e319ef.tar.gz vyos-1x-f7d00a91e42d668bb23a63673b4e1b36d8e319ef.zip |
pppoe: T1318: fix migrator and add missing link statement
Diffstat (limited to 'src/migration-scripts/interfaces/4-to-5')
-rwxr-xr-x | src/migration-scripts/interfaces/4-to-5 | 14 |
1 files changed, 6 insertions, 8 deletions
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) |