summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim <kim.sidney@gmail.com>2021-03-29 12:11:09 -0700
committerGitHub <noreply@github.com>2021-03-29 12:11:09 -0700
commit4b38aa2ff697e04154243b68e7527010a702e1f5 (patch)
tree527565b512a078d128c65c87f8d9f729a519e1a0
parentf4e75241abf121b20e0063402bbc32087e8fdb4f (diff)
parent2f72bee35078604e9059ae5f8ae5c127ee05db4c (diff)
downloadvyos-cloud-init-4b38aa2ff697e04154243b68e7527010a702e1f5.tar.gz
vyos-cloud-init-4b38aa2ff697e04154243b68e7527010a702e1f5.zip
Merge pull request #39 from UnicronNL/current
domain-name: T3446: Cloudinit error message when empty domain is pass…
-rw-r--r--cloudinit/config/cc_vyos.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py
index 42b442fc..e632b1fa 100644
--- a/cloudinit/config/cc_vyos.py
+++ b/cloudinit/config/cc_vyos.py
@@ -441,8 +441,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))