Commit 3f8d003b authored by Martín Ferrari's avatar Martín Ferrari

Rename subprocess to avoid more clashes

parent 2ed2f600
......@@ -48,10 +48,6 @@ class Node(object):
assert nexthop or interface
def add_default_route(self, nexthop, interface = None):
return self.add_route('0.0.0.0', 0, nexthop, interface)
def start_process(self, args):
return netns.subprocess.start_process(node, args)
def run_process(self, args):
return ("", "")
def get_routes(self):
return set()
......
......@@ -7,7 +7,7 @@ try:
except ImportError:
from yaml import Loader, Dumper
import base64, os, passfd, re, signal, socket, sys, traceback, unshare, yaml
import netns.subprocess
import netns.subprocess_
# ============================================================================
# Server-side protocol implementation
......@@ -298,7 +298,7 @@ class Server(object):
def do_PROC_RUN(self, cmdname):
try:
# self._proc['close_fds'] = True # forced
chld = netns.subprocess.spawn(**self._proc)
chld = netns.subprocess_.spawn(**self._proc)
except:
(t, v, tb) = sys.exc_info()
r = ["Failure starting process: %s" % str(v)]
......@@ -330,9 +330,9 @@ class Server(object):
self.reply(500, "Process does not exist.")
return
if cmdname == 'PROC POLL':
ret = netns.subprocess.poll(pid)
ret = netns.subprocess_.poll(pid)
else:
ret = netns.subprocess.wait(pid)
ret = netns.subprocess_.wait(pid)
if ret != None:
self._children.remove(pid)
......@@ -443,7 +443,7 @@ class Client(object):
"""Start a subprocess in the slave; the interface resembles
subprocess.Popen, but with less functionality. In particular
stdin/stdout/stderr can only be None or a open file descriptor.
See netns.subprocess.spawn for details."""
See netns.subprocess_.spawn for details."""
if executable == None:
executable = argv[0]
......
......@@ -98,6 +98,7 @@ class TestInterfaces(unittest.TestCase):
prefix_len = 64)
devs = get_devs_netns(node0)
print devs
self.assertTrue( {
'addr': '10.0.0.1', 'plen': 24,
'bcast': '10.0.0.255', 'family': 'inet'
......
#!/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
import netns, netns.subprocess, test_util
import netns, netns.subprocess_, test_util
import grp, os, pwd, signal, socket, sys, time, unittest
from netns.subprocess import *
from netns.subprocess_ import *
def _stat(path):
try:
......
......@@ -2,7 +2,7 @@
# vim:ts=4:sw=4:et:ai:sts=4
import re, subprocess, sys
import netns.subprocess
import netns.subprocess_
def process_ipcmd(str):
cur = None
......@@ -59,9 +59,8 @@ def get_devs():
return process_ipcmd(outdata)
def get_devs_netns(node):
(outdata, errdata) = netns.subprocess.backticks_raise(node,
["ip", "addr", "list"])
return process_ipcmd(outdata)
out = netns.subprocess_.backticks_raise(node, ["ip", "addr", "list"])
return process_ipcmd(out)
# Unittest from Python 2.6 doesn't have these decorators
def skip(text):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment