From: Claudio-Daniel Freire Date: Fri, 24 Jun 2011 16:03:15 +0000 (+0200) Subject: Fix TapIface trace sync and traces_info X-Git-Tag: nepi_v2_1~22 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=115f18d43c8b641a05b703e6706aa0acfeea84ea;p=nepi.git Fix TapIface trace sync and traces_info --- 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(