cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #03569
Re: [Merge] ~raharper/cloud-init:ubuntu-devel-new-artful-release-v7 into cloud-init:ubuntu/devel
Diff comments:
> diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
> index 6faf01b..890dbf8 100644
> --- a/cloudinit/net/network_state.py
> +++ b/cloudinit/net/network_state.py
> @@ -465,6 +466,18 @@ class NetworkStateInterpreter(object):
> for param, val in command.get('params', {}).items():
> iface.update({param: val})
>
> + # convert value to boolean
> + bridge_stp = iface.get('bridge_stp')
> + if bridge_stp and type(bridge_stp) != bool:
Also why do we use type() everywhere instead of isinstance(bridge_stp, bool)? isinstance is a bit more flexible when dealing with subclasses whereas type is quite fragile on that front (not that it matters here... but just sayin')
> + if bridge_stp in ['on', '1', 1]:
> + bridge_stp = True
> + elif bridge_stp in ['off', '0', 0]:
> + bridge_stp = False
> + else:
> + raise ValueError("Cannot convert bridge_stp value"
> + "(%s) to boolean", bridge_stp)
> + iface.update({'bridge_stp': bridge_stp})
> +
> interfaces.update({iface['name']: iface})
>
> @ensure_command_keys(['address'])
--
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/331892
Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:ubuntu-devel-new-artful-release-v7 into cloud-init:ubuntu/devel.