aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-06-17 13:11:59 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-06-21 14:22:51 -0400
commit98c3e33deac1b3a7214f46059867947c4a04f63d (patch)
treebde655922947e32ac0366e79e2effa5bba85e9ed
parent581429ca65131711c96f9d56bf2f0e18779aec2e (diff)
downloadsos-98c3e33deac1b3a7214f46059867947c4a04f63d.tar.gz
[report] Log a warning message when trying to encrypt with --build
Since --build does not produce a tarball, we cannot encrypt any collections. However, the encryption options are set in the global option group so we cannot add a report-only option to that mutex group. Instead, print a warning informing the user of this limitation. Closes: #2568 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sos/report/__init__.py b/sos/report/__init__.py
index 79c1dae0..7ad2d24a 100644
--- a/sos/report/__init__.py
+++ b/sos/report/__init__.py
@@ -1245,6 +1245,9 @@ class SoSReport(SoSComponent):
finally:
os.umask(old_umask)
else:
+ if self.opts.encrypt_pass or self.opts.encrypt_key:
+ self.ui_log.warn("\nUnable to encrypt when using --build. "
+ "Encryption is only available for archives.")
# move the archive root out of the private tmp directory.
directory = self.archive.get_archive_path()
dir_name = os.path.basename(directory)