From 68532cb818c6920d4719b82ba4bb2fc48604dbed Mon Sep 17 00:00:00 2001 From: Rod A Santiago Date: Wed, 20 Apr 2016 08:43:39 -0700 Subject: [PATCH] daemon: added option API TLVs so that per-interface parameters are kept for EMANE models when a single node has multiple interfaces of the same EMANE model type but different model parameters --- daemon/core/netns/vnet.py | 6 ++++++ daemon/core/session.py | 13 ++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/daemon/core/netns/vnet.py b/daemon/core/netns/vnet.py index 8dd1c494..d09d59ea 100644 --- a/daemon/core/netns/vnet.py +++ b/daemon/core/netns/vnet.py @@ -11,6 +11,8 @@ vnet.py: PyCoreNet and LxBrNet classes that implement virtual networks using Linux Ethernet bridging and ebtables rules. ''' +import traceback + import os, sys, threading, time, subprocess from core.api import coreapi @@ -345,6 +347,10 @@ class LxBrNet(PyCoreNet): ''' Configure link parameters by applying tc queuing disciplines on the interface. ''' + + sys.stderr.write("enter linkconfig() ...\n") + traceback.print_stack() + if devname is None: devname = netif.localname tc = [TC_BIN, "qdisc", "replace", "dev", devname] diff --git a/daemon/core/session.py b/daemon/core/session.py index 223bd9e9..9e226f53 100644 --- a/daemon/core/session.py +++ b/daemon/core/session.py @@ -14,7 +14,6 @@ that manages a CORE session. import os, sys, tempfile, shutil, shlex, atexit, gc, pwd import threading, time, random import traceback -import subprocess from core.api import coreapi if os.uname()[0] == "Linux": @@ -290,16 +289,8 @@ class Session(object): self.warn("Error writing hook '%s': %s" % (filename, e)) self.info("Running hook %s for state %s" % (filename, state)) try: - stdout = open(os.path.join(self.sessiondir, - filename + '.log'), 'w') - stderr = subprocess.STDOUT - except: - stdout = None - stderr = None - try: - check_call(["/bin/sh", filename], stdin=open(os.devnull, 'r'), - stdout=stdout, stderr=stderr, close_fds=True, - cwd=self.sessiondir, env=self.getenviron()) + check_call(["/bin/sh", filename], cwd=self.sessiondir, + env=self.getenviron()) except Exception, e: self.warn("Error running hook '%s' for state %s: %s" % (filename, state, e))