summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-03-28 13:44:37 -0500
committerScott Moser <smoser@brickies.net>2017-03-30 13:02:24 -0400
commit18762d706a2527b8a9ae94e4497b5c3f4a7c845e (patch)
treeaa53c4e0b7f1b41eda27b6ccb3ed9b55bee8b2f3
parent32b21ee7245bf00d55f875506ffc149aad9bb546 (diff)
downloadvyos-cloud-init-18762d706a2527b8a9ae94e4497b5c3f4a7c845e.tar.gz
vyos-cloud-init-18762d706a2527b8a9ae94e4497b5c3f4a7c845e.zip
netplan: remove debugging prints, add debug logging
Remove debugging print statements. Change a few to use logging.debug() where useful.
-rw-r--r--cloudinit/net/netplan.py9
1 files changed, 4 insertions, 5 deletions
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 = {}