<div dir="ltr"><div>Forgot to paste the link to the related code:</div><div><br></div><a href="https://git.openstack.org/cgit/openstack/vitrage/tree/vitrage/entity_graph/mappings/datasource_info_mapper.py#n61">https://git.openstack.org/cgit/openstack/vitrage/tree/vitrage/entity_graph/mappings/datasource_info_mapper.py#n61</a><div><br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 9, 2018 at 2:34 PM Yujun Zhang (ZTE) <<a href="mailto:zhangyujun%2Bzte@gmail.com">zhangyujun+zte@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi root causers<div><br></div><div>I have been inspecting the code about aggregated state recently and have a question regarding the rules.</div><div><br></div><div>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.</div><div><br></div><div><pre style="padding:0px;margin-top:0px;margin-bottom:0px;font-size:14px"><code>        if datasource_name in self.datasources_state_confs or \
                datasource_name <b>not</b> in self.conf.datasources.types:            ...
</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;font-size:14px"><code>        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)</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;font-size:14px"><div style="font-family:sans-serif;font-size:small;white-space:normal"><br class="m_-8074369476058284280inbox-inbox-Apple-interchange-newline">There are some test case describing the expected behavior. But I couldn't understand the design philosophy behind it. What is expected when </div><div style="font-family:sans-serif;font-size:small;white-space:normal"><ol><li>the data source is not defined</li><li>data source defined but state config not exist</li><li>data source defined, state config exist but the state is not found.<br></li></ol><div>Could somebody shed some light on it?</div><div><br></div></div></pre></div></div><br clear="all"><br>-- <br><div dir="ltr" class="m_-8074369476058284280gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Yujun Zhang</div></div></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Yujun Zhang</div></div>