summaryrefslogtreecommitdiff
path: root/src/conf_mode/dns_dynamic.py
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-11-09 16:12:58 -0600
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-11-10 00:09:55 -0600
commit66e45beb91ecc22e9ae662434ecce6ac3ea1ceb8 (patch)
tree0392964c4cee2460bb914b8c79f97a95682a0066 /src/conf_mode/dns_dynamic.py
parent1f4e9bc3860e4829fe35ecfcbf32d9d4eb00f777 (diff)
downloadvyos-1x-66e45beb91ecc22e9ae662434ecce6ac3ea1ceb8.tar.gz
vyos-1x-66e45beb91ecc22e9ae662434ecce6ac3ea1ceb8.zip
ddclient: T5708: Additional smoketests for web-options
Add additional smoketests for web-options validation. Also, format error messages to optionally include protocol name.
Diffstat (limited to 'src/conf_mode/dns_dynamic.py')
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index d6ef620fe..2bccaee0f 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -93,7 +93,7 @@ def verify(dyndns):
# Dynamic DNS service provider - configuration validation
if 'service' in dyndns['address'][address]:
for service, config in dyndns['address'][address]['service'].items():
- error_msg_req = f'is required for Dynamic DNS service "{service}" on "{address}" with protocol "{config["protocol"]}"'
+ error_msg_req = f'is required for Dynamic DNS service "{service}" on "{address}"'
error_msg_uns = f'is not supported for Dynamic DNS service "{service}" on "{address}" with protocol "{config["protocol"]}"'
for field in ['host_name', 'password', 'protocol']:
@@ -101,13 +101,13 @@ def verify(dyndns):
raise ConfigError(f'"{field.replace("_", "-")}" {error_msg_req}')
if config['protocol'] in zone_necessary and 'zone' not in config:
- raise ConfigError(f'"zone" {error_msg_req}')
+ raise ConfigError(f'"zone" {error_msg_req} with protocol "{config["protocol"]}"')
if config['protocol'] not in zone_supported and 'zone' in config:
raise ConfigError(f'"zone" {error_msg_uns}')
if config['protocol'] not in username_unnecessary and 'username' not in config:
- raise ConfigError(f'"username" {error_msg_req}')
+ raise ConfigError(f'"username" {error_msg_req} with protocol "{config["protocol"]}"')
if config['protocol'] not in ttl_supported and 'ttl' in config:
raise ConfigError(f'"ttl" {error_msg_uns}')