diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2019-12-06 22:11:12 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2019-12-06 21:11:12 -0700 |
commit | 34ec440c1ad61c23c34b46f1798813d0f3ada952 (patch) | |
tree | 9253f6b5fadc74a90e390d2c7c8c56bc6cdced03 /cloudinit/net/network_state.py | |
parent | dac551be5cf048fd481316419a6aad46a2a11abb (diff) | |
download | vyos-cloud-init-34ec440c1ad61c23c34b46f1798813d0f3ada952.tar.gz vyos-cloud-init-34ec440c1ad61c23c34b46f1798813d0f3ada952.zip |
network_state: handle empty v1 config (#45)
Sending a valid but empty v1 network config resulted in a
stacktrace during execution. Update the network_state
parse path to specific check if the 'config' key is None
(not present) versus being present but explicitly empty.
Also add some network_state unittests.
LP: #1852496
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 7d206a1a..f3e8e250 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -73,7 +73,7 @@ def parse_net_config_data(net_config, skip_broken=True): # pass the whole net-config as-is config = net_config - if version and config: + if version and config is not None: nsi = NetworkStateInterpreter(version=version, config=config) nsi.parse_config(skip_broken=skip_broken) state = nsi.get_network_state() |