[openstack-dev] [vitrage] rules in vitrage_aggregated_state()

Yujun Zhang (ZTE) zhangyujun+zte at gmail.com
Tue Jan 9 06:34:45 UTC 2018


Forgot to paste the link to the related code:

https://git.openstack.org/cgit/openstack/vitrage/tree/vitrage/entity_graph/mappings/datasource_info_mapper.py#n61



On Tue, Jan 9, 2018 at 2:34 PM Yujun Zhang (ZTE) <zhangyujun+zte at gmail.com>
wrote:

> Hi root causers
>
> I have been inspecting the code about aggregated state recently and have a
> question regarding the rules.
>
> The "not" operator in the if clause confuses me. If it is not a configured
> data source, how do we apply the aggregation rules? It seems this is
> handled in else clause.
>
>         if datasource_name in self.datasources_state_confs or \
>                 datasource_name *not* in self.conf.datasources.types:            ...
>
>         else:
>             self.category_normalizer[vitrage_category].set_aggregated_value(
>                 new_vertex, self.UNDEFINED_DATASOURCE)
>             self.category_normalizer[vitrage_category].set_operational_value(
>                 new_vertex, self.UNDEFINED_DATASOURCE)
>
>
> There are some test case describing the expected behavior. But I couldn't understand the design philosophy behind it. What is expected when
>
>    1. the data source is not defined
>    2. data source defined but state config not exist
>    3. data source defined, state config exist but the state is not found.
>
> Could somebody shed some light on it?
>
>
>
> --
> Yujun Zhang
>


-- 
Yujun Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180109/b200b477/attachment.html>


More information about the OpenStack-dev mailing list