summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-09-24 18:31:47 +0200
committerGitHub <noreply@github.com>2024-09-24 18:31:47 +0200
commit9661e27d8bda3873370f7ae9bb6c42da3376bed1 (patch)
tree86a66edb5857a4e87cb2c9e9df6cf58083300cb6 /src/conf_mode
parent26a9203e95e79afed725cc3bd1f401ae3ffa3707 (diff)
parentc196c6d9207ef112e478f44923b2d0bc8a15b3c9 (diff)
downloadvyos-1x-9661e27d8bda3873370f7ae9bb6c42da3376bed1.tar.gz
vyos-1x-9661e27d8bda3873370f7ae9bb6c42da3376bed1.zip
Merge pull request #4079 from nvollmar/T6719
syslog: T6719: fix the behavior of "syslog global preserve-fqdn"
Diffstat (limited to 'src/conf_mode')
-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 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):