Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/pavilion/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ 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()
path.mkdir(parents=True, exist_ok=True)
except OSError as err:
raise ConfigCmdError("Could not create specified directory", err)

Expand Down Expand Up @@ -247,7 +246,7 @@ def create_config_dir(self, pav_cfg: config.PavConfig, path: Path,
for subdir in ('hosts', 'modes', 'platforms', '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)
Expand Down
Loading