fix the update_capabilities action input

Bug #1608539 reported by Jiri Tomasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo-common
Fix Released
Undecided
Jeff Peeler

Bug Description

Based on the discussion here: https://review.openstack.org/#/c/348537/4/tripleo_common/actions/heat_capabilities.py

The environments input to UpdateCapabilitiesAction should be in following format: http://paste.openstack.org/show/545129/

for each of the environments from the input, the action should make sure that all enabled environments (value is true) are stored in mistral environment and any disabled environments are removed from mistral environment.

Also, block of code that takes care of fetching mistral environment is duplicated in heat_capabilities module, so it should get extracted into separate function

Revision history for this message
Jeff Peeler (jpeeler-z) wrote :

The tested input here is different from the 545129 paste, with slightly different quoting:

{
 "container": "overcloud",
 "environments": {
  "overcloud-resource-registry-puppet.yaml": true,
  "environments/puppet-pacemaker.yaml": false,
  "environments/docker.yaml": false,
  "environments/neutron-ml2-bigswitch.yaml": false,
  "environments/neutron-ml2-cisco-n1kv.yaml": false,
  "environments/neutron-ml2-cisco-nexus-ucsm.yaml": false,
  "environments/cinder-netapp-config.yaml": false,
  "environments/puppet-ceph-external.yaml": false,
  "environments/puppet-ceph-devel.yaml": false,
  "environments/storage-environment.yaml": false,
  "environments/config-debug.yaml": false,
  "environments/mongodb-nojournal.yaml": false,
  "environments/overcloud-steps.yaml": false,
  "environments/network-isolation.yaml": false,
  "environments/net-bond-with-vlans.yaml": false,
  "environments/net-single-nic-with-vlans.yaml": false
 }
}

Due to the way the code is structured with a try, except, and a return, I don't think refactoring will actually shorten the code any. If you have an example that does I can include it though.

Revision history for this message
Jeff Peeler (jpeeler-z) wrote :
Jeff Peeler (jpeeler-z)
Changed in tripleo-common:
assignee: nobody → Jeff Peeler (jpeeler-z)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/349732
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=c8f613835a48c3c13171f97f3f7ab1211a8262e9
Submitter: Jenkins
Branch: master

commit c8f613835a48c3c13171f97f3f7ab1211a8262e9
Author: Jeff Peeler <email address hidden>
Date: Mon Aug 1 18:46:29 2016 -0400

    Change input for UpdateCapabilitiesAction

    The format has changed slightly with the values no longer being a dict,
    but simply being true/false.

    Change-Id: I24c0189b2164c7a839be359e9c5858c9c23d9ab0
    Closes-bug: #1608539

Changed in tripleo-common:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 5.0.0

This issue was fixed in the openstack/tripleo-common 5.0.0 release.

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.