From 2368ae3fd0629eb2392fe6f307b32b383cd1b123 Mon Sep 17 00:00:00 2001 From: Paul Ferrell <pferrell@lanl.gov> Date: Wed, 26 Mar 2025 09:56:57 -0600 Subject: [PATCH 1/3] Allow for setup in existing directories. --- lib/pavilion/commands/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pavilion/commands/config.py b/lib/pavilion/commands/config.py index 1b40b2577..54ccc5aac 100644 --- a/lib/pavilion/commands/config.py +++ b/lib/pavilion/commands/config.py @@ -205,7 +205,7 @@ def create_config_dir(self, pav_cfg: config.PavConfig, path: Path, # This should fail if it already exists. try: - path.mkdir() + path.mkdir(parents=True, exist_ok=True) except OSError as err: raise ConfigCmdError("Could not create specified directory", err) From 822968910abbc59eb0b6426f4eeed0bf44fb65fe Mon Sep 17 00:00:00 2001 From: Paul Ferrell <51765748+Paul-Ferrell@users.noreply.github.com> Date: Thu, 27 Mar 2025 07:27:30 -0600 Subject: [PATCH 2/3] Update config.py --- lib/pavilion/commands/config.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pavilion/commands/config.py b/lib/pavilion/commands/config.py index 54ccc5aac..e25c508ff 100644 --- a/lib/pavilion/commands/config.py +++ b/lib/pavilion/commands/config.py @@ -203,7 +203,6 @@ def create_config_dir(self, pav_cfg: config.PavConfig, path: Path, raise ConfigCmdError("Given label '{}' already exists in the pav config." .format(label)) - # This should fail if it already exists. try: path.mkdir(parents=True, exist_ok=True) except OSError as err: From 3a28f1dcfe0ceaad7d361a549b81a9f4399e9080 Mon Sep 17 00:00:00 2001 From: Paul Ferrell <51765748+Paul-Ferrell@users.noreply.github.com> Date: Thu, 27 Mar 2025 07:28:25 -0600 Subject: [PATCH 3/3] Update config.py --- lib/pavilion/commands/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pavilion/commands/config.py b/lib/pavilion/commands/config.py index e25c508ff..5caa27137 100644 --- a/lib/pavilion/commands/config.py +++ b/lib/pavilion/commands/config.py @@ -246,7 +246,7 @@ def create_config_dir(self, pav_cfg: config.PavConfig, path: Path, for subdir in ('hosts', 'modes', 'os', 'plugins', 'collections', 'suites'): subdir = path/subdir try: - subdir.mkdir() + subdir.mkdir(exist_ok=True) except OSError as err: shutil.rmtree(path) raise ConfigCmdError("Could not make config subdir '{}'".format(subdir), err)