pkt_gen: STC - Handle Results DB file synchronization failures.
[vswitchperf.git] / tools / pkt_gen / testcenter / testcenter-rfc2889-rest.py
index cfa425e..ddb6456 100644 (file)
@@ -265,8 +265,13 @@ def main():
         resultsdb = args.results_dir + \
             lab_server_resultsdb.split("/Results")[1]
 
-        logger.info(
-            "The local summary DB file has been saved to %s", resultsdb)
+        if not os.path.exists(resultsdb):
+            resultsdb = lab_server_resultsdb
+            logger.info("Failed to create the local summary DB file, using"
+                        " the remote DB file instead.")
+        else:
+            logger.info(
+                "The local summary DB file has been saved to %s", resultsdb)
 
         resultsdict = (
             stc.perform("QueryResult",