diff --git a/bin/ci/ci_gantt_chart.py b/bin/ci/ci_gantt_chart.py index 1b098f8e016..44f39865f68 100755 --- a/bin/ci/ci_gantt_chart.py +++ b/bin/ci/ci_gantt_chart.py @@ -16,7 +16,8 @@ import plotly.graph_objs as go from gitlab import Gitlab, base from gitlab.v4.objects import ProjectPipeline from gitlab_common import (GITLAB_URL, get_gitlab_pipeline_from_url, - pretty_duration, read_token) + get_token_from_default_dir, pretty_duration, + read_token) def calculate_queued_at(job) -> datetime: @@ -157,6 +158,9 @@ def main( output: str | None, ci_timeout: float = 60, ): + if token is None: + token = get_token_from_default_dir() + token = read_token(token) gl = Gitlab(url=GITLAB_URL, private_token=token, retry_transient_errors=True) diff --git a/bin/ci/ci_post_gantt.py b/bin/ci/ci_post_gantt.py index be37b1fd171..3749d68392a 100755 --- a/bin/ci/ci_post_gantt.py +++ b/bin/ci/ci_post_gantt.py @@ -21,7 +21,8 @@ from ci_gantt_chart import generate_gantt_chart from gitlab import Gitlab from gitlab.base import RESTObject from gitlab.v4.objects import Project, ProjectPipeline -from gitlab_common import GITLAB_URL, get_gitlab_pipeline_from_url, read_token +from gitlab_common import (GITLAB_URL, get_gitlab_pipeline_from_url, + get_token_from_default_dir, read_token) class MockGanttExit(Exception): @@ -115,6 +116,9 @@ def main( ci_timeout: float = 60, ): log.basicConfig(level=log.INFO) + if token is None: + token = get_token_from_default_dir() + token = read_token(token) gl = Gitlab(url=GITLAB_URL, private_token=token, retry_transient_errors=True)