Skip to content

Commit

Permalink
Remove dependency on python3.10 (glob root_dir)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayaverdier committed Apr 13, 2022
1 parent 3d70acf commit 970a92b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions instater/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ def _extract_with(context: Context, task_args: dict) -> List[dict]:
raise InstaterError("Must provide at most one `with_*` looping attribute")

if fileglob:
root_dir = None
if not fileglob.startswith("/"):
root_dir = str(context.root_directory)
fileglob = str(context.root_directory) + "/" + fileglob

return [{"item": path} for path in glob(fileglob, root_dir=root_dir, recursive=True)]
return [{"item": path} for path in glob(fileglob, recursive=True)]

return [{}]

Expand Down Expand Up @@ -247,11 +246,11 @@ def run_tasks(
override_variables: dict = None,
tags: Iterable[str] = None,
dry_run: bool = False,
skip_run: bool = False,
skip_tasks: bool = False,
):
context = _load_context(setup_file, override_variables, tags, dry_run)

if not skip_run:
if not skip_tasks:
for task in context.tasks:
task.run_task(context)
print()
Expand Down

0 comments on commit 970a92b

Please sign in to comment.