2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

Use YAML comments for durations rather than parentheses

This will allow the values to be parsed using standard yaml processing
tools, and still provide the value in a human friendly form.
This commit is contained in:
Mark Andrews
2024-10-31 16:52:11 +11:00
parent 68cdc4774c
commit 378bc7cfa6
2 changed files with 12 additions and 11 deletions

View File

@@ -3720,18 +3720,17 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section,
snprintf(buf, sizeof(buf), " %u", secs);
ADD_STRING(target, buf);
ADD_STRING(target, " (");
ADD_STRING(target, " # ");
result = dns_ttl_totext(secs, true,
true, target);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
ADD_STRING(target, ")");
ADD_STRING(target, "\n");
if (optlen == 8U) {
key = isc_buffer_getuint32(
&optbuf);
ADD_STRING(target, "\n");
INDENT(style);
ADD_STRING(target,
"KEY-LEASE:");
@@ -3739,16 +3738,15 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section,
" %u", key);
ADD_STRING(target, buf);
ADD_STRING(target, " (");
ADD_STRING(target, " # ");
result = dns_ttl_totext(
key, true, true,
target);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
ADD_STRING(target, ")");
ADD_STRING(target, "\n");
}
ADD_STRING(target, "\n");
continue;
}
break;
@@ -3774,13 +3772,13 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section,
secs = isc_buffer_getuint32(&optbuf);
snprintf(buf, sizeof(buf), " %u", secs);
ADD_STRING(target, buf);
ADD_STRING(target, " (");
ADD_STRING(target, " # ");
result = dns_ttl_totext(secs, true,
true, target);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
ADD_STRING(target, ")\n");
ADD_STRING(target, "\n");
continue;
}
break;