From 616885376d94529a3e113fe9efa3c32836d3c7cb Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Fri, 26 Sep 2025 10:50:43 +0200 Subject: [PATCH] refs #2848 log less stuff --- CHANGELOG.md | 6 ++++++ ogclient/lib/python3/GitLib/__init__.py | 27 +++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cae1007..1146975 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.6.2] - 2025-09-26 + +### Fixed + +- Have gitlib log less stuff, to prevent the execution from getting stuck + ## [1.6.1] - 2025-09-25 ### Fixed diff --git a/ogclient/lib/python3/GitLib/__init__.py b/ogclient/lib/python3/GitLib/__init__.py index 06990ab..b3fed26 100755 --- a/ogclient/lib/python3/GitLib/__init__.py +++ b/ogclient/lib/python3/GitLib/__init__.py @@ -427,14 +427,22 @@ class OpengnsysGitLibrary: if result.returncode == 0: self.logger.debug("Completed, return code %i", result.returncode) - self.logger.debug("STDOUT: %s", result.stdout) - self.logger.debug("STDERR: %s", result.stderr) + #self.logger.debug("STDOUT: %s", result.stdout) + #self.logger.debug("STDERR: %s", result.stderr) else: # An error return code can be returned for reasons like missing files, so we deal this # as non-fatal. self.logger.error("Completed, return code %i", result.returncode) - self.logger.error("STDOUT: %s", result.stdout) + + #self.logger.error("STDOUT: %s", result.stdout) + fd = open ('/tmp/ntfssecaudit.stdout', 'wb') + fd.write (result.stdout) + fd.close() + self.logger.error("STDERR: %s", result.stderr) + fd = open ('/tmp/ntfssecaudit.stderr', 'wb') + fd.write (result.stderr) + fd.close() self.fs.temp_remount(mountdata) @@ -504,6 +512,9 @@ class OpengnsysGitLibrary: boot_device = self.fs.find_boot_device() boot_mount = self.fs.find_mountpoint(boot_device) + if boot_mount is None: + self.logger.warning(f"Not installing EFI files--boot_mount is None") + return self.logger.info(f"Installing EFI files in {boot_mount}") meta_dir = os.path.join(root_directory, ".opengnsys-metadata") @@ -620,7 +631,7 @@ class OpengnsysGitLibrary: self.logger.debug(f"Archive: {metadata}") for entry in metadata: - self.logger.debug(entry) + #self.logger.debug(entry) if entry.pathname in wanted_files: self.logger.debug(f"Extracting {entry}") data = bytearray() @@ -1112,7 +1123,7 @@ class OpengnsysGitLibrary: with open(os.path.join(meta_dir, "empty_directories.jsonl"), "r", encoding='utf-8') as empties_file: for line in empties_file: if line.isspace(): - self.logger.debug("Empty line, skipping") + #self.logger.debug("Empty line, skipping") continue empties_data = json.loads(line) @@ -1124,12 +1135,12 @@ class OpengnsysGitLibrary: empty_dir_keep = os.path.join(path, empty_dir, ".opengnsys-keep") - self.logger.debug(f"Empty directory: {empty_dir}") + #self.logger.debug(f"Empty directory: {empty_dir}") full_empty_dir = os.path.join(path, empty_dir) Path(full_empty_dir).mkdir(parents=True, exist_ok=True) if os.path.exists(empty_dir_keep): - self.logger.debug(f"Deleting: {empty_dir_keep}") + #self.logger.debug(f"Deleting: {empty_dir_keep}") os.unlink(empty_dir_keep) if not destructive_only: @@ -1840,7 +1851,7 @@ if __name__ == '__main__': logger.setLevel(logging.DEBUG) streamLog = logging.StreamHandler() - streamLog.setLevel(logging.INFO) + streamLog.setLevel(logging.WARNING) if not os.path.exists(opengnsys_log_dir): os.mkdir(opengnsys_log_dir)