Skip to content

Commit fde68cd

Browse files
committed
fixup! csfilter-kfp: script to filter known false positives
1 parent a9632d9 commit fde68cd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/csfilter-kfp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ def construct_prep_cmd(args):
6969
# clone git repo
7070
cmd = construct_git_cmd(args.kfp_git_url)
7171
elif args.kfp_dir:
72-
# symlink a directory
73-
cmd = f'ln -s "{args.kfp_dir}" "${{td}}/kfp"\n'
72+
# symlink an absolute path to the directory
73+
kfp_abs = os.path.realpath(args.kfp_dir)
74+
cmd = f'ln -s "{kfp_abs}" "${{td}}/kfp"\n'
7475
elif os.path.isfile(DEFAULT_KFP_JSON):
7576
# create symlinks to the known-false-positives RPM package installed on the system
7677
cmd = f'ln -s "{DEFAULT_KFP_DIR}" "${{td}}/kfp"\n' \
@@ -204,12 +205,8 @@ def main():
204205
args = parser.parse_args()
205206

206207
# if --kfp-dir is used, check that a directory was given
207-
if args.kfp_dir:
208-
if not os.path.isdir(args.kfp_dir):
209-
parser.error(f"'{args.kfp_dir}' given to --kfp-dir is not a directory")
210-
211-
# get rid of relative paths
212-
args.kfp_dir = os.path.realpath(args.kfp_dir)
208+
if args.kfp_dir and not os.path.isdir(args.kfp_dir):
209+
parser.error(f"'{args.kfp_dir}' given to --kfp-dir is not a directory")
213210

214211
# construct the command to filter
215212
try:

0 commit comments

Comments
 (0)