weixin_39883129 2020-11-29 21:14
浏览 0

1843219: All watcher missing info status

Description of change

The following PR ensures that we set the info.status before performing a store update if the old info is not nil. In other words, we need to reuse the data from the old info and set it on the new info which we'll be saving.

The reason for the tests changes, is now that we have the old data we don't need to save any changes if the data is the same.

This has been tested with pylibjuju and the status changes are now populated from the start, allowing you to monitor the changes of a charm.

QA steps

Unfortunately there is some work to test this out and requires pylibjuju for the quickest turn around...

Checkout 2.6 branch and bootstrap.

sh
git checkout 2.6
juju bootstrap lxd test --no-gui --build-agent
watch --color -n 1 juju status --color

Setup pylibjuju and apply the following changes to pylibjuju example/deploy_bundle.py: print-diff.txt It requires quite a large bundle to trigger this, so for me a very basic openstack did this.

sh
tox -e example -- examples/deploy_bundle.py

Notice how some status fields in the print output will be empty and has no "since" field:

json
"status": {"version": "", "current": "", "message": ""}

To verify the patch, check this branch out and bootstrap:

sh
juju bootstrap lxd tester --no-gui --build-agent
watch --color -n 1 juju status --color

Then run the pylibjuju example again, with the diff applied:

sh
tox -e example -- examples/deploy_bundle.py

The output should be:

json
"status": {"since": "2019-09-10T13:23:44.99699161Z", "version": "", "current": "waiting", "message": "waiting for machine"}

该提问来源于开源项目:juju/juju

  • 写回答

5条回答 默认 最新

  • weixin_39883129 2020-11-29 21:14
    关注

    https://trello.com/c/aeQmXJSa/1802-1843219-application-status-not-always-correct-in-allwatcher-investigate-adding-tests-to-pylib-and-juju

    评论

报告相同问题?