From 18762d706a2527b8a9ae94e4497b5c3f4a7c845e Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Tue, 28 Mar 2017 13:44:37 -0500 Subject: netplan: remove debugging prints, add debug logging Remove debugging print statements. Change a few to use logging.debug() where useful. --- cloudinit/net/netplan.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cloudinit/net/netplan.py') diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py index cd93b21c..7444ae33 100644 --- a/cloudinit/net/netplan.py +++ b/cloudinit/net/netplan.py @@ -6,10 +6,12 @@ import os from . import renderer from .network_state import subnet_is_ipv6 +from cloudinit import log as logging from cloudinit import util from cloudinit.net import SYS_CLASS_NET, get_devicelist +LOG = logging.getLogger(__name__) NET_CONFIG_TO_V2 = { 'bond': {'bond-ad-select': 'ad-select', 'bond-arp-interval': 'arp-interval', @@ -176,7 +178,6 @@ class Renderer(renderer.Renderer): # render from state content = self._render_content(network_state) - # ensure we poke udev to run net_setup_link if not header.endswith("\n"): header += "\n" util.write_file(fpnplan, header + content) @@ -186,7 +187,7 @@ class Renderer(renderer.Renderer): def _netplan_generate(self, run=False): if not run: - print("netplan postcmd disabled") + LOG.debug("netplan generate postcmd disabled") return util.subp(self.NETPLAN_GENERATE, capture=True) @@ -196,17 +197,15 @@ class Renderer(renderer.Renderer): the setup_link udev builtin command """ if not run: - print("netsetup postcmd disabled") + LOG.debug("netplan net_setup_link postcmd disabled") return setup_lnk = ['udevadm', 'test-builtin', 'net_setup_link'] for cmd in [setup_lnk + [SYS_CLASS_NET + iface] for iface in get_devicelist() if os.path.islink(SYS_CLASS_NET + iface)]: - print(cmd) util.subp(cmd, capture=True) def _render_content(self, network_state): - print('rendering v2 for victory!') ethernets = {} wifis = {} bridges = {} -- cgit v1.2.3