← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~chad.smith/cloud-init:set-hostname-before-network into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
> index d2f1b77..120c3cc 100644
> --- a/cloudinit/cmd/main.py
> +++ b/cloudinit/cmd/main.py
> @@ -354,7 +355,17 @@ def main_init(name, args):
>      LOG.debug("[%s] %s will now be targeting instance id: %s. new=%s",
>                mode, name, iid, init.is_new_instance())
>  
> -    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
> +    if mode == sources.DSMODE_LOCAL:
> +        # Before network comes up, set any configured hostname to allow
> +        # dhcp clients to advertize this hostname to any DDNS services
> +        # lp:1746455.
> +        cloud = init.cloudify()
> +        (hostname, _fqdn) = util.get_hostname_fqdn(
> +            init.cfg, cloud, metadata_only=True)
> +        if hostname:  # Either metadata or user-data provided hostname content

*metadata* provided hostname content, right?
user-data? you sent 'metadata_only=True'.

> +            cc_set_hostname.handle(
> +                'pre-network-set-hostname', init.cfg, cloud, LOG, None)
> +    init.apply_network_config(bring_up=bring_up)
>  
>      if mode == sources.DSMODE_LOCAL:
>          if init.datasource.dsmode != mode:


-- 
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/339720
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:set-hostname-before-network into cloud-init:master.


References