summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Vollmar <nvo@scaling.ch>2024-09-24 18:27:29 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-09-25 05:36:54 +0000
commitde9bba0e97e66d1b1254661f85b9a108518eac76 (patch)
tree32a5ee666deba515c299d01fa9c10231a4c91f05 /src
parent6450c7d964352503c99347bdf1d6bd5c673b37bd (diff)
downloadvyos-1x-de9bba0e97e66d1b1254661f85b9a108518eac76.tar.gz
vyos-1x-de9bba0e97e66d1b1254661f85b9a108518eac76.zip
syslog: T6719: fix the behavior of "syslog global preserve-fqdn"mergify/bp/sagitta/pr-4079
(cherry picked from commit c196c6d9207ef112e478f44923b2d0bc8a15b3c9)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system_syslog.py11
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):