diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-30 17:20:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 17:20:51 +0200 |
commit | 679c67e53cda6189e8add0d39988304935162071 (patch) | |
tree | 9d1e3f9528b5e3a0ac6dde57d8cac8b3893bc92f /src/conf_mode | |
parent | 1bc47f1353bc3930d0d2caf1818cb6019543dada (diff) | |
parent | de9bba0e97e66d1b1254661f85b9a108518eac76 (diff) | |
download | vyos-1x-679c67e53cda6189e8add0d39988304935162071.tar.gz vyos-1x-679c67e53cda6189e8add0d39988304935162071.zip |
Merge pull request #4098 from vyos/mergify/bp/sagitta/pr-4079
syslog: T6719: fix the behavior of "syslog global preserve-fqdn" (backport #4079)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system_syslog.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/conf_mode/system_syslog.py b/src/conf_mode/system_syslog.py index 07fbb0734..476f403bd 100755 --- a/src/conf_mode/system_syslog.py +++ b/src/conf_mode/system_syslog.py @@ -52,6 +52,17 @@ def get_config(config=None): if syslog.from_defaults(['global']): del syslog['global'] + if ( + 'global' in syslog + and 'preserve_fqdn' in syslog['global'] + and conf.exists(['system', 'host-name']) + and conf.exists(['system', 'domain-name']) + ): + hostname = conf.return_value(['system', 'host-name']) + domain = conf.return_value(['system', 'domain-name']) + fqdn = f'{hostname}.{domain}' + syslog['global']['local_host_name'] = fqdn + return syslog def verify(syslog): |