Debian Patching: Patchstate incorrect when there are no hosts

Bug #2006398 reported by Jessica Castelino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Jessica Castelino

Bug Description

Brief Description
-----------------
If there are no hosts, the patchstate is expected to be "n/a" since we can't be sure of the current patch state. However, only the first patch is set to "n/a" while the remaining patch's have a patchstate of "Available" (or whatever was previously reported for them).

The fix is fairly simple. We must move the return statement outside the for loop.
https://opendev.org/starlingx/update/src/branch/master/sw-patch/cgcs-patch/cgcs_patch/patch_controller.py#L784

Severity
--------
Minor

Steps to Reproduce
------------------
Fail the network such that no hosts are detected for patching.
Run sw-patch query

Expected Behavior
------------------
Patchstate for all patches should be "n/a"

Actual Behavior
----------------
Patchstate fpr the first patch is "n/a" and the rest show stale values.

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

System Configuration
--------------------
Multi-node system

Branch/Pull Time/Commit
-----------------------
6th Feb, 2023

Last Pass
---------
N/A

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

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

Workaround
----------
N/A

Changed in starlingx:
assignee: nobody → Jessica Castelino (jcasteli)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to update (master)

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

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

Reviewed: https://review.opendev.org/c/starlingx/update/+/872807
Committed: https://opendev.org/starlingx/update/commit/09048aa032d449c5d1c207baed8a4916b8c96334
Submitter: "Zuul (22348)"
Branch: master

commit 09048aa032d449c5d1c207baed8a4916b8c96334
Author: Jessica Castelino <email address hidden>
Date: Mon Feb 6 22:53:37 2023 +0000

    Fix: Patchstate incorrect when there are no hosts

    If there are no hosts, the patchstate is expected to be
    "n/a" since we can't be sure of the current patch state.
    However, only the first patch's patchstate is set to "n/a"
    while the remaining patch's have a patchstate of "Available"
    (or whatever was previously reported for them). This commit
    fixes the issue.

    Test Plan:
    Tested with unit test case

    Closes-Bug: 2006398
    Signed-off-by: Jessica Castelino <email address hidden>
    Change-Id: I7f34d35f552a04d46e3f88af9548d2e74c241310

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0 stx.update
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.