DC Debian - Failure to update install-values for subclouds

Bug #1995716 reported by Gustavo Herzmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Gustavo Herzmann

Bug Description

Brief Description
-----------------
DC Debian - Failure to update install-values for subclouds

Error:
[sysadmin@controller-0 ~(keystone_admin)]$ dcmanager subcloud update --install-values subcloud1-install-values.yaml --bmc-password Pas10word* subcloud1
b''
ERROR (app) Unable to update subcloud subcloud4

Severity
--------
<Major: System/Feature is usable but degraded>

Steps to Reproduce
------------------
Update install-values for subclouds post subcloud deployment

Expected Behavior
------------------
The following command should work:

dcmanager subcloud update --install-values subcloud1-install-values.yaml

Actual Behavior
----------------
It fails to update the install-values, however we can still update other values (location, description, or anything outside the --install-values parameter).

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

System Configuration
--------------------
DC

Branch/Pull Time/Commit
-----------------------
22.12_debian_2022-10-25_19-14-04

Last Pass
---------
Build from Sept, 12th

Timestamp/Logs
--------------
Found this error on the dcmanager-api.log:
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/pecan/core.py", line 683, in _call_
     self.invoke_controller(controller, args, kwargs, state)
  File "/usr/lib/python3/dist-packages/pecan/core.py", line 574, in invoke_controller
     result = controller(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/dcmanager/api/controllers/v1/subclouds.py", line 1149, in patch
    if self._validate_install_values(payload, subcloud):
  File "/usr/lib/python3/dist-packages/dcmanager/api/controllers/v1/subclouds.py", line 574, in _validate_install_values
    payload['install_values'].update({'bmc_password': bmc_password})
AttributeError: 'str' object has no attribute 'update'

Test Activity
-------------
Feature Testing

Workaround
----------
n/a

Changed in starlingx:
assignee: nobody → Gustavo Herzmann (gherzman)
Changed in starlingx:
status: New → In Progress
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/+/863669

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

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/863669
Committed: https://opendev.org/starlingx/distcloud/commit/2c8cf582df4c28f600f17e3e6fff831176c2afa9
Submitter: "Zuul (22348)"
Branch: master

commit 2c8cf582df4c28f600f17e3e6fff831176c2afa9
Author: Gustavo Herzmann <email address hidden>
Date: Fri Nov 4 11:44:33 2022 -0300

    Fix update install-values for subclouds

    Currently, all parameter values are being enclosed in quotes when
    parsing the subcloud update request. This works fine for string
    parameters (description, location, group-id, etc.), however it causes
    an issue with the install-values parameter, since it's an yaml file.
    This causes the yaml.safe_load() to return a string instead of a
    dictionary with the parsed install-values content.

    This fix simplifies the parsing function (_get_patch_data) by only
    applying the yaml.safe_load() function to the install-values parameter.
    Enclosing the fields in quotes is not necessary anymore (related to
    issue #1989619, change #857762).

    Test plan:
    PASS: Update the subcloud description and location through Horizon;
    PASS: Update the subcloud with the --install-values parameter through
    the CLI.
    PASS: Manage a subcloud with the --force parameter (the subcloud manage
    command uses the subcloud update endpoint and accepts the --force
    param.)

    Closes-Bug: #1995716
    Related-bug: #1989619

    Signed-off-by: Gustavo Herzmann <email address hidden>
    Change-Id: I40194f1b6bf7a8bd480914eac6b659be3e021d19

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