Blob Blame History Raw
From 1b9c2032149488a2372d188a8ed3251e364f41cf Mon Sep 17 00:00:00 2001
From: Emilien Macchi <emilien@redhat.com>
Date: Wed, 24 Apr 2019 20:54:05 -0400
Subject: [PATCH] [openstack_instack] add ansible.log

Collect /var/lib/mistral/config-download-latest/ansible.log which is an
important log to be able to debug issues with Ansible playbooks.

/var/lib/mistral/config-download-latest is a directory that exists
anyway on the undercloud and is the place where the ansible logs is
stored.

Note: we don't want to collect the whole /var/lib/mistral because it
contains sensitive informations like username/passwords/endpoints.

rhbz#1702806
rhbz#1702802

Resolves: #1661

Signed-off-by: Emilien Macchi <emilien@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/openstack_instack.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py
index e3470f5a..15e6c384 100644
--- a/sos/plugins/openstack_instack.py
+++ b/sos/plugins/openstack_instack.py
@@ -22,7 +22,8 @@ NON_CONTAINERIZED_DEPLOY = [
 CONTAINERIZED_DEPLOY = [
         '/var/log/heat-launcher/',
         '/home/stack/install-undercloud.log',
-        '/home/stack/undercloud-install-*.tar.bzip2'
+        '/home/stack/undercloud-install-*.tar.bzip2',
+        '/var/lib/mistral/config-download-latest/ansible.log'
 ]
 
 
-- 
2.17.2

From ba77701624dccf3ba98fee6e9cdb9b9d804068c2 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 9 Jul 2019 13:23:37 +0200
Subject: [PATCH] [archive] convert absolute symlink targets to relative

Calling _make_leading_paths for a symlink with absolute symlink target
must create the symlink relative to the source. This will prevent
creating symlinks outside sosreport build dir.

Resolves: #1710

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 sos/archive.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sos/archive.py b/sos/archive.py
index 9e19426c5..dcd6908d1 100644
--- a/sos/archive.py
+++ b/sos/archive.py
@@ -232,6 +232,11 @@ def in_archive(path):
                     dest = self._make_leading_paths(target_src, mode=mode)
                     dest = os.path.normpath(dest)
 
+                    # In case symlink target is an absolute path, make it
+                    # relative to the directory with symlink source
+                    if os.path.isabs(target):
+                        target = os.path.relpath(target, target_dir)
+
                     self.log_debug("Making symlink '%s' -> '%s'" %
                                    (abs_path, target))
                     os.symlink(target, abs_path)