← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master

 

One inline comment about a potential alternative that may be more palatable/specific.

Diff comments:

> diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
> index e73b57b..a56ced2 100644
> --- a/cloudinit/sources/DataSourceAzure.py
> +++ b/cloudinit/sources/DataSourceAzure.py
> @@ -591,6 +591,18 @@ def address_ephemeral_resize(devpath=RESOURCE_DISK_PATH, maxwait=120,
>      return
>  
>  
> +def _is_bounce_command_missing_dependency(command):
> +    '''Return True if bounce command is unsupported.'''
> +    if isinstance(command, (list, tuple)):

Since the datasource command is configurable by the underlying images, we can't be certain if it's a list, tuple  or single string. Need to check potential types  for ifdown calls.

One, maybe more specific alternative to util.which('ifdown') would be specifically test 
 util.subp(['systemctl', 'is-enabled', 'systemd-networkd']) for 'enabled'. If enabled and 'ifdown' in command, we Skip.

> +        for item in command:
> +            if 'ifdown' in item and not util.which('ifdown'):
> +                return True
> +    else:
> +        if 'ifdown' in command and not util.which('ifdown'):
> +            return True
> +    return False
> +
> +
>  def perform_hostname_bounce(hostname, cfg, prev_hostname):
>      # set the hostname to 'hostname' if it is not already set to that.
>      # then, if policy is not off, bounce the interface using command


-- 
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/335470
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:azure-no-ifupdown into cloud-init:master.


References