From a0d7802c3164727abac9cb1066e5248aa5b1adf4 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 22 May 2012 14:45:46 -0400 Subject: remove usage of subprocess.check_output in order to work on python 2.6, replace usage of check_output with util.subp. --- cloudinit/netinfo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cloudinit/netinfo.py') diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py index 7e07812e..aac4af04 100644 --- a/cloudinit/netinfo.py +++ b/cloudinit/netinfo.py @@ -19,14 +19,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import subprocess +import cloudinit.util as util def netdev_info(empty=""): fields = ("hwaddr", "addr", "bcast", "mask") - ifcfg_out = str(subprocess.check_output(["ifconfig", "-a"])) + (ifcfg_out, _err) = util.subp(["ifconfig", "-a"]) devs = {} - for line in ifcfg_out.splitlines(): + for line in str(ifcfg_out).splitlines(): if len(line) == 0: continue if line[0] not in ("\t", " "): @@ -70,9 +70,9 @@ def netdev_info(empty=""): def route_info(): - route_out = str(subprocess.check_output(["route", "-n"])) + (route_out, _err) = util.subp(["route", "-n"]) routes = [] - for line in route_out.splitlines()[1:]: + for line in str(route_out).splitlines()[1:]: if not line: continue toks = line.split() -- cgit v1.2.3