summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/devel/net_convert.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/cmd/devel/net_convert.py')
-rwxr-xr-xcloudinit/cmd/devel/net_convert.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/cloudinit/cmd/devel/net_convert.py b/cloudinit/cmd/devel/net_convert.py
index 1ad7e0bd..9b768304 100755
--- a/cloudinit/cmd/devel/net_convert.py
+++ b/cloudinit/cmd/devel/net_convert.py
@@ -5,13 +5,12 @@ import argparse
import json
import os
import sys
-import yaml
from cloudinit.sources.helpers import openstack
from cloudinit.sources import DataSourceAzure as azure
from cloudinit.sources import DataSourceOVF as ovf
-from cloudinit import distros
+from cloudinit import distros, safeyaml
from cloudinit.net import eni, netplan, network_state, sysconfig
from cloudinit import log
@@ -78,13 +77,12 @@ def handle_args(name, args):
if args.kind == "eni":
pre_ns = eni.convert_eni_data(net_data)
elif args.kind == "yaml":
- pre_ns = yaml.load(net_data)
+ pre_ns = safeyaml.load(net_data)
if 'network' in pre_ns:
pre_ns = pre_ns.get('network')
if args.debug:
sys.stderr.write('\n'.join(
- ["Input YAML",
- yaml.dump(pre_ns, default_flow_style=False, indent=4), ""]))
+ ["Input YAML", safeyaml.dumps(pre_ns), ""]))
elif args.kind == 'network_data.json':
pre_ns = openstack.convert_net_json(
json.loads(net_data), known_macs=known_macs)
@@ -100,9 +98,8 @@ def handle_args(name, args):
"input data")
if args.debug:
- sys.stderr.write('\n'.join([
- "", "Internal State",
- yaml.dump(ns, default_flow_style=False, indent=4), ""]))
+ sys.stderr.write('\n'.join(
+ ["", "Internal State", safeyaml.dumps(ns), ""]))
distro_cls = distros.fetch(args.distro)
distro = distro_cls(args.distro, {}, None)
config = {}