environment file with empty resource_registry will cause the deployment to silently fail

Bug #1707659 reported by Michele Baldessari on 2017-07-31
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Michele Baldessari

Bug Description

Made a mistake today and had an environment file like this:
  # not needed anymore

  foo: 'bar'

The deployment fails rather silently. There is an unhelpful line about 'NoneType having no items()' but it does not tell anything more.

Fix proposed to branch: master
Review: https://review.openstack.org/489258

Changed in tripleo:
assignee: nobody → Michele Baldessari (michele)
status: Triaged → In Progress
Changed in tripleo:
importance: Undecided → High

Reviewed: https://review.openstack.org/489258
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=c20150c572e50e0c41ec3a00f939ddea15b32bf5
Submitter: Jenkins
Branch: master

commit c20150c572e50e0c41ec3a00f939ddea15b32bf5
Author: Michele Baldessari <email address hidden>
Date: Mon Jul 31 17:10:55 2017 +0200

    Skip empty resource_registry sections

    With a test.yaml like the following:
    $ cat test.yaml
      # foo

    We fail like this:
    $ openstack overcloud deploy --templates -e test.yaml
    Started Mistral Workflow tripleo.validations.v1.check_pre_deployment_validations. Execution ID: 46214613-ad5c-4075-85f6-745d88928d2a
    Waiting for messages on queue 'f27e1bfa-ad33-404f-847f-4d3b6b8bf335' with no timeout.
    Removing the current plan files
    Uploading new plan files
    Started Mistral Workflow tripleo.plan_management.v1.update_deployment_plan. Execution ID: f4126d36-3566-47c3-8428-a56087ea9d0c
    Plan updated.
    Processing templates in the directory /tmp/tripleoclient-Z0maJF/tripleo-heat-templates
    'NoneType' object has no attribute 'items'
    $ echo $?

    After the fix we get the correct error from mistral and don't need to
    guess any longer:
      u'message': u'Failed to run action [action_ex_id=6bdbb294-964d-4bce-8ae4-9608b09723f6, action_cls=\'<class \'mistral.actions.action_factory.DeployStackAction\'>\', attributes=\'{}\', params=\'{u\'skip_deploy_identifier\': False, u\'container\': u\'overcloud\', u\'timeout\': 240}\']
      ERROR: Environment not in valid format: environment has empty section "resource_registry"', u'status': u'FAILED'}

    While it would have been nice to actually print the erroneous file
    as well, that would require a bigger overhaul, so for the time being
    this fix is the simplest and at least gives us some clues as to what
    is going wrong.

    Change-Id: I2638ab35c6799efa1ac8ccf4bf0dc331f75fae25
    Closes-Bug: #1707659

Changed in tripleo:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-tripleoclient 8.0.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers