forked from AlmaLinux/leapp-repository
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from prilr/cln-integration
Make CLN package repositories properly supported by the upgrade process
- Loading branch information
Showing
7 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
repos/system_upgrade/cloudlinux/actors/setclncacheonlyflag/actor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from leapp.actors import Actor | ||
from leapp.tags import PreparationPhaseTag, IPUWorkflowTag | ||
from leapp.libraries.common.cllaunch import run_on_cloudlinux | ||
|
||
|
||
class SetClnCacheOnlyFlag(Actor): | ||
""" | ||
Set a flag for the dnf-spacewalk-plugin to not attempt to contact the CLN server during transaction, | ||
as it will fail and remove CLN-based package repos from the list. | ||
When this flag exists, the plugin will act as if there's no network connection, | ||
only using the local cache. | ||
""" | ||
|
||
name = 'set_cln_cache_only_flag' | ||
consumes = () | ||
produces = () | ||
tags = (IPUWorkflowTag, PreparationPhaseTag) | ||
|
||
@run_on_cloudlinux | ||
def process(self): | ||
# TODO: Use a more reliable method to detect if we're running from the isolated userspace | ||
# TODO: Replace hardcoded path with a constant (from target_userspace_creator.constants?) | ||
with open('/var/lib/leapp/el8userspace/etc/cln_leapp_in_progress', 'w') as file: | ||
file.write('1') |
19 changes: 19 additions & 0 deletions
19
repos/system_upgrade/cloudlinux/actors/unsetclncacheonlyflag/actor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from leapp.actors import Actor | ||
from leapp.tags import PreparationPhaseTag, IPUWorkflowTag | ||
from leapp.libraries.common.cllaunch import run_on_cloudlinux | ||
|
||
import os | ||
|
||
class UnsetClnCacheOnlyFlag(Actor): | ||
""" | ||
Remove the flag for the dnf-spacewalk-plugin to not attempt to contact the CLN server during transaction. | ||
""" | ||
|
||
name = 'unset_cln_cache_only_flag' | ||
consumes = () | ||
produces = () | ||
tags = (IPUWorkflowTag, PreparationPhaseTag) | ||
|
||
@run_on_cloudlinux | ||
def process(self): | ||
os.remove('/var/lib/leapp/el8userspace/etc/cln_leapp_in_progress', 'w') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters