From de9bba0e97e66d1b1254661f85b9a108518eac76 Mon Sep 17 00:00:00 2001 From: Nicolas Vollmar Date: Tue, 24 Sep 2024 18:27:29 +0200 Subject: syslog: T6719: fix the behavior of "syslog global preserve-fqdn" (cherry picked from commit c196c6d9207ef112e478f44923b2d0bc8a15b3c9) --- src/conf_mode/system_syslog.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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): -- cgit v1.2.3