Skip to content

Commit 3157b93

Browse files
Fix configparser section error in project init
Co-authored-by: transientlunatic <4365778+transientlunatic@users.noreply.github.com>
1 parent 6b4de27 commit 3157b93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

asimov/cli/project.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def make_project(
106106
else:
107107
logger.warning("No scheduler detected, defaulting to HTCondor")
108108

109+
# Create scheduler section and set type
110+
if not config.has_section("scheduler"):
111+
config.add_section("scheduler")
109112
config.set("scheduler", "type", scheduler_type)
110113

111114
# Set scheduler-specific configuration
@@ -116,6 +119,9 @@ def make_project(
116119
else:
117120
config.set("condor", "user", user)
118121
elif scheduler_type == "slurm":
122+
# Create slurm section if it doesn't exist
123+
if not config.has_section("slurm"):
124+
config.add_section("slurm")
119125
# Set the default slurm user
120126
if not user:
121127
config.set("slurm", "user", getpass.getuser())

0 commit comments

Comments
 (0)