Skip to content

Commit

Permalink
Add action for mapping atomic repositories to support reinstallation …
Browse files Browse the repository at this point in the history
…of atomic ruleset related packages
  • Loading branch information
Mikhail Sandakov committed Mar 21, 2024
1 parent 922b62d commit 76e22b2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions actions/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,23 @@ def _do_check(self):
self.description = self.description.format(repo_paths=path)
return False
return True


class AdoptAtomicRepositories(action.ActiveAction):
atomic_repository_path: str = "/etc/yum.repos.d/tortix-common.repo"

def __init__(self):
self.name = "adopting atomic repositories"

def is_required(self):
return os.path.exists(self.atomic_repository_path)

def _prepare_action(self):
leapp_configs.add_repositories_mapping([self.atomic_repository_path])

def _post_action(self):
# We don't need to adopt repositories here because repositories uses $releasever-$basearch
pass

def _revert_action(self):
pass
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def construct_actions(options: typing.Any, stage_flag: Stages) -> typing.Dict[in
actions.LeapReposConfiguration(),
actions.LeapChoicesConfiguration(),
actions.AdoptKolabRepositories(),
actions.AdoptAtomicRepositories(),
actions.FixupImunify(),
actions.PatchLeappErrorOutput(),
actions.PatchLeappDebugNonAsciiPackager(),
Expand Down

0 comments on commit 76e22b2

Please sign in to comment.