diff options
author | Scott Moser <smoser@brickies.net> | 2019-10-24 20:02:15 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-10-24 20:02:15 +0000 |
commit | 5bec6b0e2a2ce5fd03bb04f441536fc130e67997 (patch) | |
tree | d4fbc5ae8d7360ff87c283c2550f4661ef007dff /cloudinit/net/network_state.py | |
parent | 3e2482e8aa6630ca9bc115dc1f82d44d3fde1681 (diff) | |
download | vyos-cloud-init-5bec6b0e2a2ce5fd03bb04f441536fc130e67997.tar.gz vyos-cloud-init-5bec6b0e2a2ce5fd03bb04f441536fc130e67997.zip |
Fix usages of yaml, and move yaml_dump to safeyaml.dumps.
Here we replace uses of the pyyaml module directly with functions
provided by cloudinit.safeyaml. Also, change/move
cloudinit.util.yaml_dumps
to
cloudinit.safeyaml.dumps
LP: #1849640
Diffstat (limited to 'cloudinit/net/network_state.py')
-rw-r--r-- | cloudinit/net/network_state.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index c0c415d0..b485f3d9 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -12,6 +12,7 @@ import struct import six +from cloudinit import safeyaml from cloudinit import util LOG = logging.getLogger(__name__) @@ -253,7 +254,7 @@ class NetworkStateInterpreter(object): 'config': self._config, 'network_state': self._network_state, } - return util.yaml_dumps(state) + return safeyaml.dumps(state) def load(self, state): if 'version' not in state: @@ -272,7 +273,7 @@ class NetworkStateInterpreter(object): setattr(self, key, state[key]) def dump_network_state(self): - return util.yaml_dumps(self._network_state) + return safeyaml.dumps(self._network_state) def as_dict(self): return {'version': self._version, 'config': self._config} |