diff options
author | Dan Bungert <danielbungert@gmail.com> | 2022-10-25 18:48:28 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 19:48:28 -0500 |
commit | e2042df3d8ff53294c839801a5293448b40ba4bf (patch) | |
tree | 3139b43c97e6fd0dc81269dba5cf8194d6eb11d4 /cloudinit/apport.py | |
parent | 2cc8920f8eae79ffadc66f0283c8fc55be83f76a (diff) | |
download | cloud-init-git-e2042df3d8ff53294c839801a5293448b40ba4bf.tar.gz |
apport: fix some data collection failures due to symlinks (#1797)
Apport screens out symlinks, so we should send realpath() normalized
paths instead.
Diffstat (limited to 'cloudinit/apport.py')
-rw-r--r-- | cloudinit/apport.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cloudinit/apport.py b/cloudinit/apport.py index 7f3d6e5a..4f103503 100644 --- a/cloudinit/apport.py +++ b/cloudinit/apport.py @@ -4,6 +4,8 @@ """Cloud-init apport interface""" +import os + from cloudinit.cmd.devel import read_cfg_paths from cloudinit.cmd.devel.logs import ( INSTALLER_APPORT_FILES, @@ -125,7 +127,8 @@ def attach_installer_files(report, ui=None): python modules. """ for apport_file in INSTALLER_APPORT_FILES: - attach_file_if_exists(report, apport_file.path, apport_file.label) + realpath = os.path.realpath(apport_file.path) + attach_file_if_exists(report, realpath, apport_file.label) def attach_user_data(report, ui=None): @@ -142,11 +145,11 @@ def attach_user_data(report, ui=None): if response is None: raise StopIteration # User cancelled if response: - attach_file(report, user_data_file, "user_data.txt") + realpath = os.path.realpath(user_data_file) + attach_file(report, realpath, "user_data.txt") for apport_file in INSTALLER_APPORT_SENSITIVE_FILES: - attach_file_if_exists( - report, apport_file.path, apport_file.label - ) + realpath = os.path.realpath(apport_file.path) + attach_file_if_exists(report, realpath, apport_file.label) def add_bug_tags(report): |