Skip to content

Commit

Permalink
fix: always check if auth repo exists'
Browse files Browse the repository at this point in the history
  • Loading branch information
renatav committed Sep 18, 2024
1 parent 11323e3 commit 22a5ea4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions taf/updater/updater_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(
None,
),
(
self.set_existing_repositories,
self.set_existing_target_repositories,
RunMode.UPDATE,
None,
), # specify extra method here and runner will call to check if we can have it here
Expand Down Expand Up @@ -385,16 +385,17 @@ def set_users_auth_repo(self):
path=self.auth_path, urls=[self.url]
)
self.state.auth_repo_name = self.state.users_auth_repo.name
if self.state.users_auth_repo.is_git_repository_root:
self.state.existing_repo = True

def set_existing_repositories(self):
def set_existing_target_repositories(self):
taf_logger.debug(
f"{self.state.auth_repo_name}: Checking which repositories are already on disk..."
)
self.state.existing_repo = False
self.state.repos_on_disk = {}
if self.state.users_auth_repo is not None:
if self.state.users_auth_repo.is_git_repository_root:
self.state.existing_repo = True
# load target repositories in order to check if they are clean or synced
# after updating the authentication repotiory, we need to load them again
# since repositories.json could've changed
Expand Down Expand Up @@ -573,11 +574,13 @@ def clone_remote_and_run_tuf_updater(self):
validation_repo, last_validated_remote_commit
)
)
self.state.users_auth_repo = AuthenticationRepository(
library_dir=self.library_dir,
name=self.state.auth_repo_name,
urls=[self.url],
)

if self.state.users_auth_repo.name != self.state.auth_repo_name:
self.state.users_auth_repo = AuthenticationRepository(
library_dir=self.library_dir,
name=self.state.auth_repo_name,
urls=[self.url],
)

self._validate_operation_type()
self.state.validation_auth_repo = git_updater.validation_auth_repo
Expand Down

0 comments on commit 22a5ea4

Please sign in to comment.