Postpone rendering tempest.conf till action
The tempest charm queries keystone as it comes up. If this is a fresh deploy then keystone may be unavailable when tempest performs the query and rendering tempest.conf will fail. The tempest.conf is re-rendered when the run-tempest action is triggered so it does not need to be rendered until then. Change-Id: Id7dc3b5e36dd98b53a1e438d5b805d6775a996e6 Closes-Bug: 1633044
This commit is contained in:
parent
51ff816f56
commit
bbd22a861b
|
@ -15,6 +15,9 @@ TLDR: Deploy the built charm and relate it to keystone and openstack-dashboard.
|
|||
|
||||
More docs to come as this matures.
|
||||
|
||||
Executing the run-tempest action:
|
||||
|
||||
juju run-action tempest/0 run-tempest
|
||||
|
||||
# Contact Information
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import charms.reactive as reactive
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Cloud may have different artifacts (flavors, images etc) since last run
|
||||
# so rerun handlers file to regenerate config.
|
||||
reactive.main()
|
||||
identity_int = reactive.RelationBase.from_state('identity-admin.available')
|
||||
tempest.render_configs([identity_int])
|
||||
tempest.run_test('smoke')
|
||||
|
|
|
@ -39,6 +39,13 @@ def run_test(tox_target):
|
|||
TempestCharm.singleton.run_test(tox_target)
|
||||
|
||||
|
||||
def assess_status():
|
||||
"""Use the singleton from the TempestCharm to install the packages on the
|
||||
unit
|
||||
"""
|
||||
TempestCharm.singleton.assess_status()
|
||||
|
||||
|
||||
class TempestAdminAdapter(adapters.OpenStackRelationAdapter):
|
||||
|
||||
"""Inspect relations and provide properties that can be used when
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import charms.reactive as reactive
|
||||
import charm.openstack.tempest as tempest
|
||||
|
||||
# config is rendered when the run tempest action is called
|
||||
|
||||
|
||||
@reactive.when_not('charm.installed')
|
||||
def install_packages():
|
||||
|
@ -8,6 +10,6 @@ def install_packages():
|
|||
reactive.set_state('charm.installed')
|
||||
|
||||
|
||||
@reactive.when('identity-admin.available')
|
||||
def render_tempest_config(keystone):
|
||||
tempest.render_configs([keystone])
|
||||
@reactive.when('charm.installed')
|
||||
def assess_status():
|
||||
tempest.assess_status()
|
||||
|
|
Loading…
Reference in New Issue