dcmanager subcloud-backup create error message misleading when subcloud is in pre-deploy state

Bug #1991972 reported by Hugo Nicodemos Brito
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Hugo Nicodemos Brito

Bug Description

Brief Description
-----------------
dcmanager subcloud-backup create error message misleading when subcloud is in pre-install state. The code must check both deploy status and availability for the error message

$ dcmanager subcloud list
+----+-----------+------------+--------------+---------------+-------------+---------------+----------------------------+
| id | name | management | availability | deploy status | sync | backup status | backup datetime |
+----+-----------+------------+--------------+---------------+-------------+---------------+----------------------------+
| 1 | subcloud6 | unmanaged | online | pre-install | out-of-sync | complete | 2022-09-25 23:49:08.049246 |
| 2 | subcloud8 | managed | online | complete | in-sync | unknown | None |
+----+-----------+------------+--------------+---------------+-------------+---------------+----------------------------+
$ dcmanager subcloud-backup
create delete
$ dcmanager subcloud-backup create --subcloud subcloud6 --sysadmin-password Li69nux*
Operation not allowed while subcloud is unmanaged. Please manage the subcloud and try again.

Severity
--------

Minor: The error doesn't affect the functionality

Steps to Reproduce
------------------
1. Restore the subcloud then perform backup create

Expected Behavior
------------------
Create a backup of the subcloud.

Actual Behavior
----------------
Operation is not allowed.

Reproducibility
---------------
<Reproducible>
100% reproducible.

System Configuration
--------------------
Distributed Cloud.

Branch/Pull Time/Commit
-----------------------
master

Last Pass
---------
NA

Timestamp/Logs
--------------
NA

Test Activity
-------------
NA

Workaround
----------
NA

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

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

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

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/860597
Committed: https://opendev.org/starlingx/distcloud/commit/7241800047b82b656a3a0038abd4b8718999db3a
Submitter: "Zuul (22348)"
Branch: master

commit 7241800047b82b656a3a0038abd4b8718999db3a
Author: Hugo Brito <email address hidden>
Date: Thu Oct 6 14:29:24 2022 -0300

    Fix misleading subcloud backup create error message

    Run the operation dcmanager subcloud-backup when a subcloud
    is in pre-deploy state throws a misleading error message:
    Operation not allowed while subcloud is unmanaged.
    This commit prevents the subcloud-backup create command
    from running if the subcloud is in a state other than
    'complete'.

    Test Plan:
    1. Add a subcloud using dcmanager subcloud add command.
    2. Try to create a backup using dcmanager subcloud-backup
    create command while:
    - Subcloud online and managed.
    - Run the backup-create command while subcloud is in
    various states and ensure the command is only accepted
    when deploy_status is in 'complete' state.

    Closes-bug: 1991972

    Signed-off-by: Hugo Brito <email address hidden>
    Change-Id: I36d298b59e3db904addc555e18781765dba45940

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
assignee: nobody → Hugo Nicodemos Brito (hbrito)
tags: added: stx.8.0 stx.distcloud
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.