summaryrefslogtreecommitdiff
path: root/cloudinit/cmd
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2022-05-31 14:13:22 -0600
committerGitHub <noreply@github.com>2022-05-31 14:13:22 -0600
commit153a7ea25e0d15f707a37655c06cf7155114ea11 (patch)
tree6e549496c5f858b203f958a52a247c668cf37201 /cloudinit/cmd
parentde606405de2d016b7b82ae6d0e0595fd44094ab1 (diff)
downloadcloud-init-git-153a7ea25e0d15f707a37655c06cf7155114ea11.tar.gz
net-convert: use yaml.dump for debugging python NetworkState obj (#1484)
When debugging python's NetworkState intance we cannot use safeyaml.dumps because that leverages the yaml.SafeDumper which does not allow rendering python objects. Use yamls.dump instead. * Additional fix for networkd renderer to create /etc/systemd/network if it does not exist LP: #1975907
Diffstat (limited to 'cloudinit/cmd')
-rwxr-xr-xcloudinit/cmd/devel/net_convert.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/cmd/devel/net_convert.py b/cloudinit/cmd/devel/net_convert.py
index e3f58e90..f92efe72 100755
--- a/cloudinit/cmd/devel/net_convert.py
+++ b/cloudinit/cmd/devel/net_convert.py
@@ -7,6 +7,8 @@ import json
import os
import sys
+import yaml
+
from cloudinit import distros, log, safeyaml
from cloudinit.net import (
eni,
@@ -132,9 +134,7 @@ def handle_args(name, args):
ns = network_state.parse_net_config_data(pre_ns)
if args.debug:
- sys.stderr.write(
- "\n".join(["", "Internal State", safeyaml.dumps(ns), ""])
- )
+ sys.stderr.write("\n".join(["", "Internal State", yaml.dump(ns), ""]))
distro_cls = distros.fetch(args.distro)
distro = distro_cls(args.distro, {}, None)
config = {}