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.
CLOS-2759: The elevation process failed during stage 3 - Cache-only e…
…nabled but no cache for 'cloudlinux-x86_64-server-8' * Pin CLN mirror before downloading packages to cache * Unpin after first boot * Fix error handling in CLN cache only flag handling
- Loading branch information
Grigory Ponomarenko
committed
Jul 9, 2024
1 parent
a17bd9e
commit e431b97
Showing
6 changed files
with
149 additions
and
6 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
47 changes: 47 additions & 0 deletions
47
repos/system_upgrade/cloudlinux/actors/unpinclnmirror/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,47 @@ | ||
import os | ||
|
||
from leapp.actors import Actor | ||
from leapp.libraries.common.cllaunch import run_on_cloudlinux | ||
from leapp.libraries.common.cln_switch import get_target_userspace_path | ||
from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag | ||
|
||
class UnpinClnMirror(Actor): | ||
""" | ||
Remove the pinned CLN mirror. | ||
See the pin_cln_mirror actor for more details. | ||
""" | ||
|
||
name = 'unpin_cln_mirror' | ||
consumes = () | ||
produces = () | ||
tags = (IPUWorkflowTag, FirstBootPhaseTag) | ||
|
||
CLN_REPO_ID = "cloudlinux-x86_64-server-8" | ||
DEFAULT_CLN_MIRROR = "https://xmlrpc.cln.cloudlinux.com/XMLRPC/" | ||
|
||
@run_on_cloudlinux | ||
def process(self): | ||
target_userspace = get_target_userspace_path() | ||
|
||
for mirrorlist_path in [ | ||
'/etc/mirrorlist', | ||
os.path.join(target_userspace, 'etc/mirrorlist'), | ||
]: | ||
try: | ||
os.remove(mirrorlist_path) | ||
except OSError: | ||
self.log.info('mirrorlist does not exist, doing nothing.') | ||
|
||
for up2date_path in [ | ||
'/etc/sysconfig/rhn/up2date', | ||
os.path.join(target_userspace, 'etc/sysconfig/rhn/up2date'), | ||
]: | ||
try: | ||
with open(up2date_path, 'r') as file: | ||
lines = [ | ||
line for line in file.readlines() if 'etc/mirrorlist' not in line | ||
] | ||
with open(up2date_path, 'w') as file: | ||
file.writelines(lines) | ||
except (OSError, IOError, ValueError): | ||
self.log.info('Can update %s file, doing nothing', up2date_path) |
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