collect exclude list handling is not always working

Bug #2070671 reported by Eric MacDonald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Eric MacDonald

Bug Description

Brief Description
-----------------
If the collect exclude list contains dirs or files that are found in the collect include list then those intended exclude files are not excluded.

Tar favors the include list content over the exclude list content in its include/exclude handling.

Severity
--------
Minor: Some intended excluded files are included when they should not be.

Steps to Reproduce
------------------
run collect

Expected Behavior
------------------
If /var/log/lastlog were in the collect exclude list then it should be excluded

Actual Behavior
----------------
It is not excluded if that same file exists in the include list

Reproducibility
---------------
100%

System Configuration
--------------------
Any

Branch/Pull Time/Commit
-----------------------
Any prior to the release of a fix for this issue.

Last Pass
---------
Never noticed. Test escape.

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Developer Testing

Workaround
----------
Not easy. maybe remove the offending exclude file before running collect.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to utilities (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/922856

Changed in starlingx:
status: New → In Progress
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to utilities (master)

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/922856
Committed: https://opendev.org/starlingx/utilities/commit/87d962dc77142d5e2bc5a30b358f60212c99d801
Submitter: "Zuul (22348)"
Branch: master

commit 87d962dc77142d5e2bc5a30b358f60212c99d801
Author: Eric MacDonald <email address hidden>
Date: Wed Jun 26 17:09:12 2024 +0000

    Fix collect_host exclude list handling

    The Collect Tool has a feature that omits a list of files
    or directories that should be excluded from the collect bundle.
    This is referred to as an exclude list.
    There is a similar include list.

    Collect is not always honoring what is specified in the exclude list.

    Both the include and exclude lists are passed to the 'tar' utility.
    Tar prioritizes the include list contents over the exclude list
    contents for any file or directory that exists in both lists.
    This is not correct behavior for collect.
    The exclude list should take priority.

    This update introduces a filter function that ensures any dir or file
    in the exclude list is removed from the include list and then passes
    the potentially updated include list to the tar utility.

    Test Plan:

    PASS: Verify build install and 'collect all' in a AIO DX system.
    PASS: Verify the contents of the exclude list is prioritized
          over the include list when there is the same entry in both lists.
    PASS: Verify a file that is specified in the exclude list
          is not collected.
    PASS: Verify a directory that is specified in the exclude list
          is not collected.
    PASS: Verify handling when there is no duplication between the lists.

    Closes-Bug: 2070671
    Change-Id: Ifc117803b4d675d137e1d807652e90ccf9212191
    Signed-off-by: Eric MacDonald <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.10.0 stx.tools
Changed in starlingx:
assignee: nobody → Eric MacDonald (rocksolidmtce)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.