diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-09-20 13:53:55 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-09-20 14:46:26 +0200 |
commit | 993f6873c02f3f79013acedfe61ce705bdb3a4d0 (patch) | |
tree | ac1b93a2eada6091b9274cdd934aa35baac0a61f /src/migration-scripts/interfaces/12-to-13 | |
parent | 0a21905786d31e759416dd335d87726f9ed46ffa (diff) | |
download | vyos-1x-993f6873c02f3f79013acedfe61ce705bdb3a4d0.tar.gz vyos-1x-993f6873c02f3f79013acedfe61ce705bdb3a4d0.zip |
wwan: ifconfig: T2905: sync CLI nodes in dialup interfaces
Both PPPoE and WWAN interfaces are dialer interfaces handled by ppp, but use
different CLI nodes for the same functionality. PPPoE has "connect-on-demand"
to initiate an "on-demand" dialing and WWAN uses "ondemand" for this purpose.
Rename WWAN "ondemand" node to "connect-on-demand".
Diffstat (limited to 'src/migration-scripts/interfaces/12-to-13')
-rwxr-xr-x | src/migration-scripts/interfaces/12-to-13 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/migration-scripts/interfaces/12-to-13 b/src/migration-scripts/interfaces/12-to-13 index 17d1d0b0a..f866ca9a6 100755 --- a/src/migration-scripts/interfaces/12-to-13 +++ b/src/migration-scripts/interfaces/12-to-13 @@ -17,6 +17,8 @@ # - T2903: Change vif-s ethertype from numeric number to literal # - 0x88a8 -> 802.1ad # - 0x8100 -> 802.1q +# - T2905: Change WWAN "ondemand" node to "connect-on-demand" to have identical +# CLI nodes for both types of dialer interfaces from sys import exit, argv from vyos.configtree import ConfigTree @@ -32,6 +34,9 @@ if __name__ == '__main__': config = ConfigTree(config_file) + # + # T2903 + # for type in config.list_nodes(['interfaces']): for interface in config.list_nodes(['interfaces', type]): if not config.exists(['interfaces', type, interface, 'vif-s']): @@ -48,6 +53,15 @@ if __name__ == '__main__': config.set(base_path + ['protocol'], value=protocol) config.delete(base_path + ['ethertype']) + # + # T2905 + # + wwan_base = ['interfaces', 'wirelessmodem'] + if config.exists(wwan_base): + for interface in config.list_nodes(wwan_base): + if config.exists(wwan_base + [interface, 'ondemand']): + config.rename(wwan_base + [interface, 'ondemand'], 'connect-on-demand') + try: with open(file_name, 'w') as f: f.write(config.to_string()) |