Skip to content

Commit

Permalink
Merge pull request #178 from PennLINC/fix/dir_not_exist_err
Browse files Browse the repository at this point in the history
[FIX] Output RIA path not found error
  • Loading branch information
tientong98 authored Oct 14, 2024
2 parents a9c1aa7 + a0f91d0 commit dc3ad14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions babs/babs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import os.path as op
from urllib.parse import urlparse
import subprocess
import warnings
import pandas as pd
Expand Down Expand Up @@ -206,7 +207,7 @@ def wtf_key_info(self, flag_output_ria_only=False):
# ^^ another way to change the wd temporarily: add `cwd=self.xxx` in `subprocess.run()`
# if success: no output; if failed: will raise CalledProcessError
proc_output_ria_data_dir.check_returncode()
self.output_ria_data_dir = proc_output_ria_data_dir.stdout.decode('utf-8')
self.output_ria_data_dir = urlparse(proc_output_ria_data_dir.stdout.decode('utf-8')).path
if self.output_ria_data_dir[-1:] == "\n":
# remove the last 2 characters
self.output_ria_data_dir = self.output_ria_data_dir[:-1]
Expand Down Expand Up @@ -777,8 +778,9 @@ def babs_check_setup(self, input_ds, flag_job_test):
# the one in `self` attr is directly got from `analysis` remote,
# so should not use that here.
# output_ria:
actual_output_ria_data_dir = os.readlink(
op.join(self.output_ria_path, "alias/data")) # get the symlink of `alias/data`
actual_output_ria_data_dir = urlparse(os.readlink(
op.join(self.output_ria_path, "alias/data")
)).path # get the symlink of `alias/data` then change to path
assert op.exists(actual_output_ria_data_dir) # make sure this exists
# get '000/0000-0000-0000-0000':
data_foldername = op.join(
Expand Down

0 comments on commit dc3ad14

Please sign in to comment.