From fde7e76321f07ef5f1b44528f4137a436fc42c96 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Tue, 14 Feb 2017 10:20:34 -0500 Subject: [PATCH] Store all Rally results under common "rally" directory This is going to help us easily identify the workload for post processing of JSONs and remove the need for complex regexes and logic in lib/Tools.py for post-processing. Since we have the flexibility to pass *args now, I am also deleting an unused method which is no longer needed. Change-Id: I54e601dde25bba6e5239f4ee1d3a61893cdb50a1 --- lib/Rally.py | 7 ++++--- lib/Tools.py | 14 +++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/Rally.py b/lib/Rally.py index 083a6765c..08483b759 100644 --- a/lib/Rally.py +++ b/lib/Rally.py @@ -264,9 +264,10 @@ class Rally(WorkloadBase.WorkloadBase): "Overriding Scenario Args: {}".format(scenario)) result_dir = self.tools.create_results_dir( - self.config['browbeat'][ - 'results'], dir_ts, benchmark['name'], - scenario_name) + self.config['browbeat']['results'], dir_ts, + self.__class__.__name__.lower(), + benchmark['name'], scenario_name + ) self.logger.debug( "Created result directory: {}".format(result_dir)) workload = self.__class__.__name__ diff --git a/lib/Tools.py b/lib/Tools.py index a51e6b4a9..92e484edf 100644 --- a/lib/Tools.py +++ b/lib/Tools.py @@ -52,17 +52,9 @@ class Tools(object): else: return command.strip() - def create_run_dir(self, results_dir, run): - try: - os.makedirs("%s/run-%s" % (results_dir, run)) - return "%s/run-%s" % (results_dir, run) - except OSError: - return False - - # Create directory for results - def create_results_dir(self, results_dir, timestamp, service, scenario): - the_directory = "{}/{}/{}/{}".format(results_dir, - timestamp, service, scenario) + # Create directory for results + def create_results_dir(self, *args): + the_directory = '/'.join(args) if not os.path.isdir(the_directory): try: os.makedirs(the_directory)