SHA256
1
0
forked from pool/cloud-init
cloud-init/drop-python27-only-code.diff

23 lines
880 B
Diff

Index: cloud-init-0.6.3/cloudinit/netinfo.py
===================================================================
--- cloud-init-0.6.3.orig/cloudinit/netinfo.py
+++ cloud-init-0.6.3/cloudinit/netinfo.py
@@ -24,7 +24,7 @@ import subprocess
def netdev_info(empty=""):
fields = ("hwaddr", "addr", "bcast", "mask")
- ifcfg_out = str(subprocess.check_output(["ifconfig", "-a"]))
+ ifcfg_out = str(subprocess.Popen(["ifconfig", "-a"], stdout=subprocess.PIPE).communicate()[0])
devs = {}
for line in ifcfg_out.splitlines():
if len(line) == 0:
@@ -70,7 +70,7 @@ def netdev_info(empty=""):
def route_info():
- route_out = str(subprocess.check_output(["route", "-n"]))
+ route_out = str(subprocess.Popen(["route", "-n"], stdout=subprocess.PIPE).communicate()[0])
routes = []
for line in route_out.splitlines()[1:]:
if not line: