cleanup the trace_file thing
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 21 Sep 2011 13:28:53 +0000 (15:28 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 21 Sep 2011 13:28:53 +0000 (15:28 +0200)
system/TestMain.py

index 43405d9..6fba5c3 100755 (executable)
@@ -125,7 +125,6 @@ steps refer to a method in TestPlc or to a step_* module
         parser.add_option("-r","--restart-nm", action="store_true", dest="forcenm", default=False, 
                           help="Force the NM to restart in ssh_slices step")
         parser.add_option("-t","--trace", action="store", dest="trace_file", default=None,
-                          #default="logs/trace-@TIME@.txt",
                           help="Trace file location")
         (self.options, self.args) = parser.parse_args()
 
@@ -328,17 +327,11 @@ steps refer to a method in TestPlc or to a step_* module
         
         # init & open trace file if provided
         if self.options.trace_file and not self.options.dry_run:
-            time=strftime("%H-%M")
-            date=strftime("%Y-%m-%d")
-            trace_file=self.options.trace_file
-            trace_file=trace_file.replace("@TIME@",time)
-            trace_file=trace_file.replace("@DATE@",date)
-            self.options.trace_file=trace_file
             # create dir if needed
-            trace_dir=os.path.dirname(trace_file)
+            trace_dir=os.path.dirname(self.options.trace_file)
             if trace_dir and not os.path.isdir(trace_dir):
                 os.makedirs(trace_dir)
-            trace=open(trace_file,"w")
+            trace=open(self.options.trace_file,"w")
 
         # do all steps on all plcs
         TIME_FORMAT="%H-%M-%S"