Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New root password spoke #44

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anabot/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def is_liveimg_install():
if os.path.exists('/run/install/ks.cfg'):
with open('/run/install/ks.cfg', 'r') as ks:
for line in ks.readlines():
if re.search("\s*liveimg.*\s+--url", line):
if re.search(r"\s*liveimg.*\s+--url", line):
return True
return False

15 changes: 13 additions & 2 deletions anabot/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from anabot.conditions import is_distro_version_ge

try: # python3
from configparser import RawConfigParser
Expand All @@ -20,20 +21,30 @@
'profile_name': None,
}

# From python3.12 RawConfigParser doesn't have readfp method, we need to use read_file instead for RHEL 10 and Fedora 40
def use_read_file():
return is_distro_version_ge('rhel', 10) or is_distro_version_ge('fedora', 40)
You-never-know marked this conversation as resolved.
Show resolved Hide resolved

def init_config(profile_name):
global _profile_name
global _config

ini_path = os.path.join(profiles_path, profile_name + '.ini')
_config = RawConfigParser(allow_no_value=True)
defaults = open(defauls_path, 'r')
_config.readfp(defaults)
if use_read_file():
_config.read_file(defaults)
else:
_config.readfp(defaults)
try:
local_conf_path = os.environ.get(
'ANABOT_CONF', os.path.join(os.getcwd(), 'anabot.ini')
)
with open(local_conf_path) as local_conf:
_config.readfp(local_conf)
if use_read_file():
_config.read_file(local_conf)
else:
_config.readfp(local_conf)
except OSError:
# couldn't find or read 'anabot.ini'
pass
Expand Down
3 changes: 3 additions & 0 deletions anabot/runtime/installation/hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def _wait_for_depsolve(initial=True):
filename = '/tmp/anaconda.log'
waitline = '.*software_selection: The selection has been checked.*'

if is_distro_version_ge('rhel', 10):
You-never-know marked this conversation as resolved.
Show resolved Hide resolved
waitline = '.*The software selection has been resolved.*'

if wait_for_line(filename, waitline, 600):
reporter.log_info("Depsolving finished, nothing should block anaconda main thread now (GTK/ATK) now")
else:
Expand Down
5 changes: 5 additions & 0 deletions anabot/runtime/installation/hub/partitioning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ def additional_space_manipulate2(element, app_node, local_node, dry_run):
"I would like to _make additional space available.",
context="GUI|Storage",
)
if is_distro_version_ge('rhel', 10):
You-never-know marked this conversation as resolved.
Show resolved Hide resolved
checkbox_text = tr(
"Free up space by re_moving or shrinking existing partitions",
context="GUI|Storage",
)
additional_checkbox = getnode_scroll(local_node, "check box", checkbox_text)
if not dry_run:
if (action == "enable") != additional_checkbox.checked:
Expand Down
Loading