Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-358870: Backport the fixes from #67 to filter the XAPI ClusterD DB for XS8, Yangtze #78

Merged

Conversation

bernhardkaindl
Copy link
Collaborator

@bernhardkaindl bernhardkaindl commented Feb 14, 2024

CA-358870: Backport the fixes to filter the XAPI Clusterd DB for XS8, Yangtze:

Fixes for filter_xapi_clusterd_db():

  1. Remove the clusterd token (backport of @edwintorok's patch)
    (cherry picked from CA-388587: Fix filtering the xapi-clusterd db and log any errors #67, 9a64b44)
  2. Fix KeyError if pems and authkey don't exist in DB (backport of @edwintorok's patch)
    (cherry picked from CA-388587: Fix filtering the xapi-clusterd db and log any errors #67, e4a80b6)
  3. Log any errors in filter_xapi_clusterd_db()
    If Exceptions would occur in the future, log them to the bugtool log (with testcase for it)
    (cherry picked from CA-388587: Fix filtering the xapi-clusterd db and log any errors #67, 5fd22f8)

The 'token' is an API token that is used to authenticate all API
requests to the xapi-clusterd daemon.

- Apply the fix originally developed and tested by Edwin.
- Update the tests:

  - Ensure that the fix works and keeps working across future changes.

Co-authored-by: Bernhard Kaindl <[email protected]>
Signed-off-by: Edwin Török <[email protected]>
(cherry picked from commit 9a64b44)
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2024

Codecov Report

Merging #78 (946a873) into release/xs8 (bc49be2) will increase coverage by 0%.
The diff coverage is 100%.

Additional details and impacted files
@@            Coverage Diff             @@
##           release/xs8    #78   +/-   ##
==========================================
  Coverage           85%    85%           
==========================================
  Files               16     16           
  Lines             2000   2019   +19     
==========================================
+ Hits              1702   1722   +20     
+ Misses             298    297    -1     
Files Coverage Δ
tests/unit/test_filter_xapi_clusterd_db.py 100% <100%> (ø)
xen-bugtool 81% <100%> (+<1%) ⬆️
Flag Coverage Δ
python2.7-xs8-yangtze 85% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

… instead

Handle the situations where configs doesn't have "pems" keys:

Yangtze does not have REQ-403 and the REQ-403 API changed later to pass
the PEMs in files, so the clusterd DB only has their path names:

Ignore the pems keys if not there and sanitize the rest of the config.

- Applies the fix originally developed and tested by Edwin.
- Update the tests:

  - Ensure that the fix works and keeps working across future changes.

Co-authored-by: Bernhard Kaindl <[email protected]>
Signed-off-by: Edwin Török <[email protected]>
(cherry picked from commit e4a80b6)
Signed-off-by: Bernhard Kaindl <[email protected]>
(cherry picked from commit 5fd22f8)
@bernhardkaindl bernhardkaindl changed the title CA-358870: Fix 1: filter_xapi_clusterd_db: remove token from the report CA-358870: Fix [1,2,3 of 3]: Backport the fix to filter the XAPI Clusterd DB: remove token, pems, authkey (if they exist) Feb 14, 2024
@bernhardkaindl bernhardkaindl changed the title CA-358870: Fix [1,2,3 of 3]: Backport the fix to filter the XAPI Clusterd DB: remove token, pems, authkey (if they exist) CA-358870: Backport the fixes from #67 to filter the XAPI ClusterD DB for XS8, Yangtze Feb 14, 2024
@bernhardkaindl bernhardkaindl merged commit b93cd6e into xenserver:release/xs8 Feb 14, 2024
2 checks passed
@bernhardkaindl bernhardkaindl deleted the xs8-fix-clusterdb-filter branch February 24, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants