From 115f18d43c8b641a05b703e6706aa0acfeea84ea Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Fri, 24 Jun 2011 18:03:15 +0200 Subject: [PATCH] Fix TapIface trace sync and traces_info --- src/nepi/testbeds/planetlab/tunproto.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/nepi/testbeds/planetlab/tunproto.py b/src/nepi/testbeds/planetlab/tunproto.py index 243b7c24..ef3e94a0 100644 --- a/src/nepi/testbeds/planetlab/tunproto.py +++ b/src/nepi/testbeds/planetlab/tunproto.py @@ -385,6 +385,12 @@ class TunProtoBase(object): break time.sleep(interval) interval = min(30.0, interval * 1.1) + + def remote_trace_path(self, whichtrace): + if whichtrace != 'packets': + return None + + return os.path.join(self.home_path, 'capture') def sync_trace(self, local_dir, whichtrace): if whichtrace != 'packets': @@ -398,13 +404,14 @@ class TunProtoBase(object): local_path = os.path.join(local_dir, 'capture') # create parent local folders - proc = subprocess.Popen( - ["mkdir", "-p", os.path.dirname(local_path)], - stdout = open("/dev/null","w"), - stdin = open("/dev/null","r")) + if os.path.dirname(local_path): + proc = subprocess.Popen( + ["mkdir", "-p", os.path.dirname(local_path)], + stdout = open("/dev/null","w"), + stdin = open("/dev/null","r")) - if proc.wait(): - raise RuntimeError, "Failed to synchronize trace: %s %s" % (out,err,) + if proc.wait(): + raise RuntimeError, "Failed to synchronize trace" # sync files (out,err),proc = server.popen_scp( -- 2.47.0