summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Bungert <danielbungert@gmail.com>2022-10-25 18:48:28 -0600
committerGitHub <noreply@github.com>2022-10-25 19:48:28 -0500
commite2042df3d8ff53294c839801a5293448b40ba4bf (patch)
tree3139b43c97e6fd0dc81269dba5cf8194d6eb11d4
parent2cc8920f8eae79ffadc66f0283c8fc55be83f76a (diff)
downloadcloud-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.
-rw-r--r--cloudinit/apport.py13
-rwxr-xr-xcloudinit/cmd/devel/logs.py4
-rw-r--r--tools/.github-cla-signers1
3 files changed, 11 insertions, 7 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):
diff --git a/cloudinit/cmd/devel/logs.py b/cloudinit/cmd/devel/logs.py
index 385554d8..1c944a0f 100755
--- a/cloudinit/cmd/devel/logs.py
+++ b/cloudinit/cmd/devel/logs.py
@@ -40,10 +40,10 @@ INSTALLER_APPORT_SENSITIVE_FILES = [
INSTALLER_APPORT_FILES = [
ApportFile("/var/log/installer/ubuntu_desktop_installer.log", "UdiLog"),
ApportFile(
- "/var/log/installer/subiquity-server-debug.log", "SubiquityLog"
+ "/var/log/installer/subiquity-server-debug.log", "SubiquityServerDebug"
),
ApportFile(
- "/var/log/installer/subiquity-client-debug.log", "SubiquityClientLog"
+ "/var/log/installer/subiquity-client-debug.log", "SubiquityClientDebug"
),
ApportFile("/var/log/installer/curtin-install.log", "CurtinLog"),
ApportFile(
diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers
index accb3b26..de10523c 100644
--- a/tools/.github-cla-signers
+++ b/tools/.github-cla-signers
@@ -29,6 +29,7 @@ Conan-Kudo
cvstealth
dankenigsberg
david-caro
+dbungert
ddymko
dermotbradley
dhensby