Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libjuju get_status appears to return None occassionally for the list of units for an application #406

Open
ajkavanagh opened this issue Jan 8, 2021 · 0 comments

Comments

@ajkavanagh
Copy link
Collaborator

ajkavanagh commented Jan 8, 2021

Evidence:

13:38:23 2021-01-06 13:38:14 [WARNING] get_provider_type from zaza.openstack.utilities.juju is deprecated. Please use the equivalent from zaza.utilities.juju
13:38:23 2021-01-06 13:38:14 [INFO] Using config /var/lib/jenkins/.local/share/juju/clouds.yaml
13:38:23 2021-01-06 13:38:14 [INFO] AUTH_URL: http://10.245.161.156:5000/v3, api_ver: 3
13:38:23 2021-01-06 13:38:14 [INFO] Using keystone API V3 (or later) for undercloud auth
13:38:23 2021-01-06 13:38:16 [WARNING] unknown delta type: id
13:38:23 2021-01-06 13:38:20 [WARNING] unknown delta type: id
13:38:23 /var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
13:38:23   from cryptography.hazmat.backends import default_backend
13:38:23 Traceback (most recent call last):
13:38:23   File "/tmp/tmp.KrWZIk35cT/mojo-openstack-specs/trusty/osci-mojo/spec/specs/full_stack/stable_to_next_ha/mitaka/network_setup.py", line 20, in <module>
13:38:23     cacert=cacert))
13:38:23   File "/var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/zaza/openstack/configure/network.py", line 303, in run_from_cli
13:38:23     options, 'no_use_juju_wait'))
13:38:23   File "/var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/zaza/openstack/configure/network.py", line 221, in setup_gateway_ext_port
13:38:23     current_release = openstack_utils.get_os_release()
13:38:23   File "/var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/zaza/openstack/utilities/openstack.py", line 1620, in get_os_release
13:38:23     release_pair = get_current_os_release_pair(application=application)
13:38:23   File "/var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/zaza/openstack/utilities/openstack.py", line 1593, in get_current_os_release_pair
13:38:23     machine = list(juju_utils.get_machines_for_application(application))[0]
13:38:23   File "/var/lib/jenkins/tools/0/charm-test-infra/.tox/clients/lib/python3.5/site-packages/zaza/utilities/juju.py", line 144, in get_machines_for_application
13:38:23     for unit in status.get("units").keys():
13:38:23 AttributeError: 'NoneType' object has no attribute 'keys'

e.g. paraphrasing to the used code-path:

status = get_full_juju_status(model_name=model_name)
status = status.applications.get(application)
for unit in status.get("units").keys():
#                          ^^^^^ here status is NoneType
    yield status.get("units").get(unit).get("machine")

Proposed workaround: try again a few times until it returns something or then die.

@ajkavanagh ajkavanagh changed the title libjuju get_status appears to return None occassionally libjuju get_status appears to return None occassionally for the list of units for an application Jan 8, 2021
coreycb pushed a commit to coreycb/zaza that referenced this issue Oct 17, 2023
A couple of changes here:

 * Ensure that the post-upgrade-hook runs BEFORE the config-changed to
   set the openstack-origin/source back to distro.  The former behaviour
   breaks keystone quite badly.
 * Ensure that the charm name is used, as discovered from the model, for
   rabbitmq-server and percona-cluster to cope with different names for
   the application in the model vs the charm name from the charm-store.
 * Check whether the machine needs to be rebooted after the dist-upgrade
   (before the do-release-upgrade), and reboot the machine first.
   Otherwise, do-release-upgrade will fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant