summaryrefslogtreecommitdiff
path: root/cloudinit/netinfo.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-05-22 14:45:46 -0400
committerScott Moser <smoser@ubuntu.com>2012-05-22 14:45:46 -0400
commita0d7802c3164727abac9cb1066e5248aa5b1adf4 (patch)
treebae1a779476ac0531c93ad0df631a924bc0da445 /cloudinit/netinfo.py
parent663989da30d81ccfe74b285d6f27fd801c0f27f9 (diff)
downloadvyos-cloud-init-a0d7802c3164727abac9cb1066e5248aa5b1adf4.tar.gz
vyos-cloud-init-a0d7802c3164727abac9cb1066e5248aa5b1adf4.zip
remove usage of subprocess.check_output
in order to work on python 2.6, replace usage of check_output with util.subp.
Diffstat (limited to 'cloudinit/netinfo.py')
-rw-r--r--cloudinit/netinfo.py10
1 files changed, 5 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
-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()