From c196c6d9207ef112e478f44923b2d0bc8a15b3c9 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" --- src/conf_mode/system_syslog.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/conf_mode/system_syslog.py') diff --git a/src/conf_mode/system_syslog.py b/src/conf_mode/system_syslog.py index 2497c5bb6..eb2f02eb3 100755 --- a/src/conf_mode/system_syslog.py +++ b/src/conf_mode/system_syslog.py @@ -53,6 +53,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