openstack-charmers / zaza-openstack-tests

OpenStack Charms Functional Test Library for Zaza
Apache License 2.0
7 stars 77 forks source link

Fix 'NoneType' object has no attribute 'get' #1191

Closed freyes closed 5 months ago

freyes commented 5 months ago

There are situations where the action object returned by libjuju may not have the 'results' attribute which leads to using the default value when running ".get('results')" which it's None.

This change sets the default value to an empty dictionary to allow the following ".get('Stdout', '')" succeed.

freyes commented 5 months ago

This PR is being exercised by this gerrit change - https://review.opendev.org/c/openstack/charm-mysql-innodb-cluster/+/912487

wolsen commented 5 months ago

I'm closing this pull request as we used PR #1192 instead, which uses the underlying zaza.model changes to not use the unit.run directly.