Skip to content

Commit 08fc848

Browse files
authored
Merge pull request galaxyproject#22112 from evilkermit/fix_rucio_temp_dir
Try to create Rucio temp directory before writing rucio.cfg
2 parents ad7b1e4 + 683fd66 commit 08fc848

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/galaxy/objectstore/rucio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ def __init__(self, rucio_object_store):
158158
def get_rucio_client(self):
159159
if not self.rucio_config_path:
160160
temp_directory = self.extra_dirs["temp"]
161-
self.rucio_config_path = os.path.join(temp_directory, "rucio.cfg")
162161
key_for_pass = "password"
163-
with open(self.rucio_config_path, "w") as f:
162+
os.makedirs(temp_directory, exist_ok=True)
163+
rucio_config_path = os.path.join(temp_directory, "rucio.cfg")
164+
with open(rucio_config_path, "w") as f:
164165
f.write(f"""[client]
165166
rucio_host = {self.config['host']}
166167
auth_host = {self.config['auth_host']}
@@ -169,6 +170,7 @@ def get_rucio_client(self):
169170
username = {self.config['username']}
170171
{key_for_pass} = {self.config[key_for_pass]}
171172
""")
173+
self.rucio_config_path = rucio_config_path
172174
# We may have crossed a forkpool boundary. No harm setting the env var again.
173175
# Fixes rucio integration tests
174176
os.environ["RUCIO_CONFIG"] = self.rucio_config_path

0 commit comments

Comments
 (0)