Bug 1766843 - Empty resource_registry breaks updates and deployments
Summary: Empty resource_registry breaks updates and deployments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alex Schultz
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-30 04:37 UTC by ldenny
Modified: 2023-09-07 20:54 UTC (History)
7 users (show)

Fixed In Version: python-tripleoclient-9.3.1-5.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-10 11:22:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1833743 0 None None None 2019-10-31 14:47:14 UTC
OpenStack gerrit 666895 0 'None' MERGED Improve handling of empty resource_registry 2020-02-29 12:07:46 UTC
OpenStack gerrit 692430 0 'None' MERGED Improve handling of empty resource_registry 2020-02-29 12:07:46 UTC
Red Hat Issue Tracker OSP-28284 0 None None None 2023-09-07 20:54:22 UTC
Red Hat Knowledge Base (Solution) 4537731 0 None None None 2019-12-05 09:28:38 UTC
Red Hat Product Errata RHBA-2020:0760 0 None None None 2020-03-10 11:22:45 UTC

Description ldenny 2019-10-30 04:37:31 UTC
Description of problem:
When an environment file with an empty resource_registry section is passed to the overcloud deploy command it errors during check_file_for_enabled_service function and returns a trace back


Version-Release number of selected component (if applicable): 
python-tripleoclient-9.2.7-11


How reproducible: 
Every time, easily.


Steps to Reproduce:
1.Create an environment file with the following content:
[stack@undercloud-0 ~]$ cat network-extras.yaml
# ---------------------------------------------------------------------------
# Custom network extras script
# ---------------------------------------------------------------------------
resource_registry:
     # OS::TripleO::NodeExtraConfigPost: extraconfig/post_deploy/default.yaml

2.Include the file in the deploy command with -e

3.Run the overcloud deploy command

Actual results:
2019-10-28 20:59:02.431 18217 ERROR osc_lib.shell [  admin] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 134, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 169, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/command.py", line 25, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_update.py", line 77, in take_action
    parsed_args.environment_files)
  File "/usr/lib/python2.7/site-packages/tripleoclient/utils.py", line 1059, in check_deprecated_service_is_enabled
    check_file_for_enabled_service(env_file)
  File "/usr/lib/python2.7/site-packages/tripleoclient/utils.py", line 1042, in check_file_for_enabled_service
    service in content["resource_registry"]):
TypeError: argument of type 'NoneType' is not iterable


Expected results:
If we can't handle files like this then we should return an error rather then a trace back. Something like "The following environment file has an empty resource_registry section: %s"

Additional info:

Comment 2 Alex Schultz 2019-10-31 14:47:14 UTC
This was fixed in train. https://review.opendev.org/#/c/666895/ We can backport it when we have time.

Comment 3 Brendan Shephard 2019-11-04 21:28:52 UTC
(In reply to Alex Schultz from comment #2)
> This was fixed in train. https://review.opendev.org/#/c/666895/ We can
> backport it when we have time.

Thanks Alex. We'll look into it for you and submit some changes for review.

Comment 4 Brendan Shephard 2019-11-05 00:24:22 UTC
Looks like you already did it actually: https://review.opendev.org/#/c/692430/

Nice. Thanks, greatly appreciated.

Comment 7 errata-xmlrpc 2020-03-10 11:22:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0760


Note You need to log in before you can comment on or make changes to this bug.