diff options
author | Chad Smith <chad.smith@canonical.com> | 2017-10-05 14:26:34 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-10-05 14:26:34 -0600 |
commit | 45d361cb0b7f5e4e7d79522bd285871898358623 (patch) | |
tree | 8bd6a938898f5a1992280ae70bea988ed9357a45 /cloudinit/net/network_state.py | |
parent | 6eb4dc24fe314ce5c98b05b21988402cda95afce (diff) | |
download | vyos-cloud-init-45d361cb0b7f5e4e7d79522bd285871898358623.tar.gz vyos-cloud-init-45d361cb0b7f5e4e7d79522bd285871898358623.zip |
net: Handle bridge stp values of 0 and convert to boolean type
Update unit tests to pass a 0 instead of 'off' to validate that network
state is properly written.
Diffstat (limited to 'cloudinit/net/network_state.py')
-rw-r--r-- | cloudinit/net/network_state.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index 890dbf8d..0e830ee8 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -468,7 +468,7 @@ class NetworkStateInterpreter(object): # convert value to boolean bridge_stp = iface.get('bridge_stp') - if bridge_stp and type(bridge_stp) != bool: + if bridge_stp is not None and type(bridge_stp) != bool: if bridge_stp in ['on', '1', 1]: bridge_stp = True elif bridge_stp in ['off', '0', 0]: |