Merge pull request 'refs #2848 log less stuff' (#124) from log-less-stuff into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details

Reviewed-on: #124
pull/125/head 1.6.2
Natalia Serrano 2025-09-26 10:51:04 +02:00
commit bcf69b6bfe
2 changed files with 25 additions and 8 deletions

View File

@ -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

View File

@ -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)