Skip to content

Commit 6cf8800

Browse files
committed
fix: Handle non-existence of /var/cache/cloud-what gracefully
* Card ID: CCT-2021 * When the directory `/var/cache/cloud-what` does not exists, then handle this situation gracefully * TODO: Unit tests of rhsm-debug expects existence of some directories in the system. The whole root directory should be mocked and rhsm-debug should use this mock in unit tests. Signed-off-by: Jiri Hnidek <jhnidek@redhat.com>
1 parent 4659422 commit 6cf8800

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/rhsm_debug/debug_commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ def _do_command(self):
166166
self._copy_directory("/var/lib/rhsm", content_path)
167167

168168
# sosreport does not collect /var/cache/cloud-what/*. It is our duty to collect it
169-
self._copy_directory("/var/cache/cloud-what", content_path)
169+
if os.path.isdir("/var/cache/cloud-what"):
170+
self._copy_directory("/var/cache/cloud-what", content_path)
170171

171172
if not sos:
172173
self._copy_cert_directory(DEFAULT_PRODUCT_CERT_DIR, content_path)

0 commit comments

Comments
 (0)