Skip to content

Commit

Permalink
Merge pull request #5247 from rvykydal/log-packages
Browse files Browse the repository at this point in the history
logging: log content of /root/lorax-packages if available
  • Loading branch information
rvykydal authored Oct 17, 2023
2 parents 312f809 + 1132267 commit 74c5256
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def setup_environment():
sys.exit(0)

log.info("%s %s", sys.argv[0], util.get_anaconda_version_string(build_time_version=True))
log.debug("Image packages list: %s", util.get_image_packages_info())

if opts.updates_url:
log.info("Using updates from: %s", opts.updates_url)
Expand Down
2 changes: 2 additions & 0 deletions pyanaconda/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ class SecretStatus(Enum):
# screenshots
SCREENSHOTS_DIRECTORY = "/tmp/anaconda-screenshots"

PACKAGES_LIST_FILE = "/root/lorax-packages.log"

CMDLINE_FILES = [
"/proc/cmdline",
"/run/install/cmdline",
Expand Down
9 changes: 8 additions & 1 deletion pyanaconda/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from pyanaconda.core.path import make_directories, open_with_perm, join_paths
from pyanaconda.core.process_watchers import WatchProcesses
from pyanaconda.core.constants import DRACUT_SHUTDOWN_EJECT, \
IPMI_ABORTED, X_TIMEOUT
IPMI_ABORTED, X_TIMEOUT, PACKAGES_LIST_FILE
from pyanaconda.core.live_user import get_live_user
from pyanaconda.errors import RemovedModuleError

Expand Down Expand Up @@ -983,3 +983,10 @@ def restorecon(paths, root, skip_nonexistent=False):
return False
else:
return True


def get_image_packages_info():
if os.path.exists(PACKAGES_LIST_FILE):
return ' '.join(line.strip() for line in open(PACKAGES_LIST_FILE).readlines())
else:
return ''

0 comments on commit 74c5256

Please sign in to comment.