diff options
author | Kim <kim.sidney@gmail.com> | 2021-03-29 12:05:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 12:05:41 -0700 |
commit | ff02b77217650789330271fa25b6d585962043c9 (patch) | |
tree | cb78f8f16400895117d94fba7b96dff3297e2de1 /cloudinit/config/cc_vyos.py | |
parent | b585a61d350e97651f94a72499b638e23657c34c (diff) | |
parent | 2089f4d8a3c9b0910465ff0a3ae2c0688ac930ff (diff) | |
download | vyos-cloud-init-ff02b77217650789330271fa25b6d585962043c9.tar.gz vyos-cloud-init-ff02b77217650789330271fa25b6d585962043c9.zip |
Merge pull request #38 from UnicronNL/crux
domain-name: T3446: Cloudinit error message when empty domain is pass…
Diffstat (limited to 'cloudinit/config/cc_vyos.py')
-rw-r--r-- | cloudinit/config/cc_vyos.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py index f9384e8b..06f5d263 100644 --- a/cloudinit/config/cc_vyos.py +++ b/cloudinit/config/cc_vyos.py @@ -427,8 +427,9 @@ def set_config_hostname(config, hostname, fqdn): if fqdn: try: domain_name = fqdn.partition("{}.".format(hostname))[2] - logger.debug("Configuring domain-name to: {}".format(hostname_filter(domain_name))) - config.set(['system', 'domain-name'], value=hostname_filter(domain_name), replace=True) + if domain_name: + logger.debug("Configuring domain-name to: {}".format(hostname_filter(domain_name))) + config.set(['system', 'domain-name'], value=hostname_filter(domain_name), replace=True) except Exception as err: logger.error("Failed to configure domain-name: {}".format(err)) |