diff options
author | Christian Breunig <christian@breunig.cc> | 2023-11-21 20:25:59 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-11-21 20:52:08 +0100 |
commit | 0e885f1bf01424130b6876e769cc42612b19351b (patch) | |
tree | f21b06cdeaa4120486c2c0deedec29c94a3e254f /src | |
parent | 3ab206b04350aec4872ed72ae4bd3440a47204f0 (diff) | |
download | vyos-1x-0e885f1bf01424130b6876e769cc42612b19351b.tar.gz vyos-1x-0e885f1bf01424130b6876e769cc42612b19351b.zip |
http: T5762: rename "virtual-host listen-port" -> "virtual-host port"
This complements commit f5e43b136 ("http: T5762: api: make API socket backend
communication the one and only default") so we have a consistent port CLI node
across VyOS components.
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/https.py | 4 | ||||
-rwxr-xr-x | src/migration-scripts/https/4-to-5 | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/conf_mode/https.py b/src/conf_mode/https.py index 028a5007a..26c4343a0 100755 --- a/src/conf_mode/https.py +++ b/src/conf_mode/https.py @@ -122,7 +122,7 @@ def verify(https): server_block = deepcopy(default_server_block) data = vhost_dict.get(vhost, {}) server_block['address'] = data.get('listen-address', '*') - server_block['port'] = data.get('listen-port', '443') + server_block['port'] = data.get('port', '443') server_block_list.append(server_block) for entry in server_block_list: @@ -156,7 +156,7 @@ def generate(https): server_block['id'] = vhost data = vhost_dict.get(vhost, {}) server_block['address'] = data.get('listen-address', '*') - server_block['port'] = data.get('listen-port', '443') + server_block['port'] = data.get('port', '443') name = data.get('server-name', ['_']) server_block['name'] = name allow_client = data.get('allow-client', {}) diff --git a/src/migration-scripts/https/4-to-5 b/src/migration-scripts/https/4-to-5 index a503e0cb7..0dfb6ac19 100755 --- a/src/migration-scripts/https/4-to-5 +++ b/src/migration-scripts/https/4-to-5 @@ -48,6 +48,12 @@ if config.exists(base + ['api', 'socket']): if config.exists(base + ['api', 'port']): config.delete(base + ['api', 'port']) +# rename listen-port -> port ver virtual-host +if config.exists(base + ['virtual-host']): + for vhost in config.list_nodes(base + ['virtual-host']): + if config.exists(base + ['virtual-host', vhost, 'listen-port']): + config.rename(base + ['virtual-host', vhost, 'listen-port'], 'port') + try: with open(file_name, 'w') as f: f.write(config.to_string()) |