diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-09-25 13:06:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 13:06:28 +0100 |
commit | 298115685900105a57302c879ba47b5420a63d92 (patch) | |
tree | 49ecbfbf5144e6c8207ff44e387b304ea7fb4119 /src | |
parent | 46f83c7d09b923e99a3632b7cc153da08cdded9a (diff) | |
parent | ea5da8d07d1733207345ec2b736359483f25d7fb (diff) | |
download | vyos-1x-298115685900105a57302c879ba47b5420a63d92.tar.gz vyos-1x-298115685900105a57302c879ba47b5420a63d92.zip |
Merge pull request #4097 from vyos/mergify/bp/circinus/pr-4079
syslog: T6719: fix the behavior of "syslog global preserve-fqdn" (backport #4079)
Diffstat (limited to 'src')
-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): |