DescriptionReturn only valid charms in elasticsearch results.
For each (possible) charm it knows about, charmworld records its status
in the main charm store (store.juju.ubuntu.com), but we did not
use this status information.
One important detail we ignored is if the charm store says that a given
charm is valid, or if it exists at all. We store this kind of status
information as a dictionary charm['store_data']; if the store "sees" an
error, this dictionary has the key 'errors'.
This branch adds an additional elasticsearch filter to the "search
expression" used by ElasticSearchClient.api_search() and
ElasticSearchClient.search() that ensures that only valid charms
are returned in search results. This behaviour can be changed by
setting the new parameter valid_charm_only to False.
As a drive-by fix, I changed the the conversion from a datetime instance
to "seconds since the Unix epoch" so that the local timezone is not
used. This fixes a failure of test_api.TestAPI0Charms.test_charms()
that is not related to my changes.
https://code.launchpad.net/~adeuring/charmworld/check-charm-exists-in-store-1160527/+merge/158951
(do not edit description out of merge proposal)
Patch Set 1 #
MessagesTotal messages: 2
|