summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_set_hostname.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/CloudConfig/cc_set_hostname.py')
-rw-r--r--cloudinit/CloudConfig/cc_set_hostname.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/cloudinit/CloudConfig/cc_set_hostname.py b/cloudinit/CloudConfig/cc_set_hostname.py
index 49368019..2b130810 100644
--- a/cloudinit/CloudConfig/cc_set_hostname.py
+++ b/cloudinit/CloudConfig/cc_set_hostname.py
@@ -24,12 +24,7 @@ def handle(name,cfg,cloud,log,args):
return(True)
try:
- hostname_prefix = util.get_cfg_option_str(cfg, "hostname_prefix", None)
- hostname_attr = util.get_cfg_option_str(cfg, "hostname_attribute", "hostname")
- hostname_function = getattr(cloud, 'get_' + hostname_attr, None)
- if hostname_fucntion is None: hostname_fucntion = cloud.get_hostname
- hostname = util.get_cfg_option_str(cfg,"hostname", hostname_function)
- if hostname_prefix: hostname = hostname_prefix + "-" + hostname
+ hostname = util.get_cfg_option_str(cfg,"hostname",cloud.get_hostname())
set_hostname(hostname, log)
except Exception as e:
util.logexc(log)