cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #01839
[Merge] ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master
Ryan Harper has proposed merging ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master.
Requested reviews:
cloud init development team (cloud-init-dev)
For more details, see:
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/321222
netplan: remove debugging prints, use logging instead
Remove debugging print statements. Change a few to use
logging.debug() where useful.
--
Your team cloud init development team is requested to review the proposed merge of ~raharper/cloud-init:net-v2-dont-print-udevadm-commands into cloud-init:master.
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
index cd93b21..7bf1021 100644
--- a/cloudinit/net/netplan.py
+++ b/cloudinit/net/netplan.py
@@ -1,6 +1,7 @@
# This file is part of cloud-init. See LICENSE file ...
import copy
+import logging
import os
from . import renderer
@@ -10,6 +11,7 @@ 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',
@@ -186,7 +188,7 @@ class Renderer(renderer.Renderer):
def _netplan_generate(self, run=False):
if not run:
- print("netplan postcmd disabled")
+ LOG.debug("netplan postcmd disabled")
return
util.subp(self.NETPLAN_GENERATE, capture=True)
@@ -196,17 +198,15 @@ class Renderer(renderer.Renderer):
the setup_link udev builtin command
"""
if not run:
- print("netsetup postcmd disabled")
+ LOG.debug("netsetup 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 = {}
Follow ups