From: Perry Gagne pgagne@redhat.com
fixed typo for run.datetime should be data.datetime
fixed how the export path is built.
Signed-off-by: Perry Gagne pgagne@redhat.com --- lnst/Controller/RecipeRunExport.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lnst/Controller/RecipeRunExport.py b/lnst/Controller/RecipeRunExport.py index b0ecccb..cf40ae4 100644 --- a/lnst/Controller/RecipeRunExport.py +++ b/lnst/Controller/RecipeRunExport.py @@ -70,15 +70,17 @@ class RecipeRunExporter: """ data = RecipeRunData(self.recipe, run) if not name: - name = f"{self.recipe_name}-run-{run.datetime:%Y-%m-%d_%H:%M:%S}.dat" + name = f"{self.recipe_name}-run-{data.datetime:%Y-%m-%d_%H:%M:%S}.dat" if not dir: - dir = os.path.join(run.log_dir, name) + dir = run.log_dir
- with open(dir, 'wb') as f: + path = os.path.join(dir, name) + + with open(path, 'wb') as f: pickle.dump(data, f)
- logging.info(f"Exported {self.recipe_name} data to {dir}") - return dir + logging.info(f"Exported {self.recipe_name} data to {path}") + return path
def export_recipe_runs(recipe: BaseRecipe) -> List[Tuple[str, RecipeRun]]: