From 1d5447b1fbde6dd22f8b90a408606e27a375caab Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 5 Jul 2022 00:50:02 -0700 Subject: [PATCH] use actual logging now --- iso/empanadas/empanadas/util/dnf_utils.py | 54 +++++++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/iso/empanadas/empanadas/util/dnf_utils.py b/iso/empanadas/empanadas/util/dnf_utils.py index ae3c638..87f6254 100644 --- a/iso/empanadas/empanadas/util/dnf_utils.py +++ b/iso/empanadas/empanadas/util/dnf_utils.py @@ -1071,7 +1071,11 @@ class RepoSync: repo_name ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' os .treeinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1087,7 +1091,11 @@ class RepoSync: os_disc_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' os .discinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1102,7 +1110,11 @@ class RepoSync: os_media_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' os media.repo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1143,7 +1155,11 @@ class RepoSync: repo_name ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' debug .treeinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1159,7 +1175,11 @@ class RepoSync: debug_disc_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' debug .discinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1174,7 +1194,11 @@ class RepoSync: debug_media_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' ' + a + ' debug media.repo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1213,7 +1237,11 @@ class RepoSync: repo_name ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' source os .treeinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1229,7 +1257,11 @@ class RepoSync: source_disc_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' source os .discinfo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' + @@ -1244,7 +1276,11 @@ class RepoSync: source_media_path ) except Exception as e: - print(e) + self.log.error( + '[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' + + repo_name + ' source os media.repo could not be written' + ) + self.log.error(e) else: self.log.warn( '[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +