<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Arial;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h1
        {mso-style-priority:9;
        mso-style-link:"Heading 1 Char";
        margin-top:24.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:"Calibri Light";
        color:#2F5496;}
h2
        {mso-style-priority:9;
        mso-style-link:"Heading 2 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:"Calibri Light";
        color:#4472C4;}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#4472C4;}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#4472C4;
        font-style:italic;}
h5
        {mso-style-priority:9;
        mso-style-link:"Heading 5 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#1F3763;
        font-weight:normal;}
h6
        {mso-style-priority:9;
        mso-style-link:"Heading 6 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#1F3763;
        font-weight:normal;
        font-style:italic;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
        {mso-style-priority:9;
        mso-style-link:"Heading 7 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#404040;
        font-style:italic;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
        {mso-style-priority:9;
        mso-style-link:"Heading 8 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:10.0pt;
        font-family:"Calibri Light";
        color:#4472C4;}
p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
        {mso-style-priority:9;
        mso-style-link:"Heading 9 Char";
        margin-top:10.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:10.0pt;
        font-family:"Calibri Light";
        color:#404040;
        font-style:italic;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
        {mso-style-priority:35;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:9.0pt;
        font-family:"Times New Roman";
        color:#4472C4;
        font-weight:bold;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
        {mso-style-priority:10;
        mso-style-link:"Title Char";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:15.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri Light";
        color:#323E4F;
        letter-spacing:.25pt;}
p.MsoTitleCxSpFirst, li.MsoTitleCxSpFirst, div.MsoTitleCxSpFirst
        {mso-style-priority:10;
        mso-style-link:"Title Char";
        mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri Light";
        color:#323E4F;
        letter-spacing:.25pt;}
p.MsoTitleCxSpMiddle, li.MsoTitleCxSpMiddle, div.MsoTitleCxSpMiddle
        {mso-style-priority:10;
        mso-style-link:"Title Char";
        mso-style-type:export-only;
        margin:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri Light";
        color:#323E4F;
        letter-spacing:.25pt;}
p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
        {mso-style-priority:10;
        mso-style-link:"Title Char";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:15.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        border:none;
        padding:0cm;
        font-size:26.0pt;
        font-family:"Calibri Light";
        color:#323E4F;
        letter-spacing:.25pt;}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
        {mso-style-priority:11;
        mso-style-link:"Subtitle Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri Light";
        color:#4472C4;
        letter-spacing:.75pt;
        font-style:italic;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
        {mso-style-priority:1;
        mso-style-link:"No Spacing Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Times New Roman";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoQuote, li.MsoQuote, div.MsoQuote
        {mso-style-priority:29;
        mso-style-link:"Quote Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;
        font-style:italic;}
p.MsoIntenseQuote, li.MsoIntenseQuote, div.MsoIntenseQuote
        {mso-style-priority:30;
        mso-style-link:"Intense Quote Char";
        margin-top:10.0pt;
        margin-right:46.8pt;
        margin-bottom:14.0pt;
        margin-left:46.8pt;
        border:none;
        padding:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:#4472C4;
        font-weight:bold;
        font-style:italic;}
span.MsoSubtleEmphasis
        {mso-style-priority:19;
        color:gray;
        font-style:italic;}
span.MsoIntenseEmphasis
        {mso-style-priority:21;
        color:#4472C4;
        font-weight:bold;
        font-style:italic;}
span.MsoSubtleReference
        {mso-style-priority:31;
        font-variant:small-caps;
        color:#ED7D31;
        text-decoration:underline;}
span.MsoIntenseReference
        {mso-style-priority:32;
        font-variant:small-caps;
        color:#ED7D31;
        letter-spacing:.25pt;
        font-weight:bold;
        text-decoration:underline;}
span.MsoBookTitle
        {mso-style-priority:33;
        font-variant:small-caps;
        letter-spacing:.25pt;
        font-weight:bold;}
p.MsoTocHeading, li.MsoTocHeading, div.MsoTocHeading
        {mso-style-priority:39;
        margin-top:24.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:"Calibri Light";
        color:#2F5496;
        font-weight:bold;}
span.Heading1Char
        {mso-style-name:"Heading 1 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 1";
        font-family:"Calibri Light";
        color:#2F5496;
        font-weight:bold;}
span.Heading2Char
        {mso-style-name:"Heading 2 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 2";
        font-family:"Calibri Light";
        color:#4472C4;
        font-weight:bold;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-family:"Calibri Light";
        color:#4472C4;
        font-weight:bold;}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Calibri Light";
        color:#4472C4;
        font-weight:bold;
        font-style:italic;}
span.Heading5Char
        {mso-style-name:"Heading 5 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 5";
        font-family:"Calibri Light";
        color:#1F3763;}
span.Heading6Char
        {mso-style-name:"Heading 6 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 6";
        font-family:"Calibri Light";
        color:#1F3763;
        font-style:italic;}
span.Heading7Char
        {mso-style-name:"Heading 7 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 7";
        font-family:"Calibri Light";
        color:#404040;
        font-style:italic;}
span.Heading8Char
        {mso-style-name:"Heading 8 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 8";
        font-family:"Calibri Light";
        color:#4472C4;}
span.Heading9Char
        {mso-style-name:"Heading 9 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 9";
        font-family:"Calibri Light";
        color:#404040;
        font-style:italic;}
span.TitleChar
        {mso-style-name:"Title Char";
        mso-style-priority:10;
        mso-style-link:Title;
        font-family:"Calibri Light";
        color:#323E4F;
        letter-spacing:.25pt;}
span.SubtitleChar
        {mso-style-name:"Subtitle Char";
        mso-style-priority:11;
        mso-style-link:Subtitle;
        font-family:"Calibri Light";
        color:#4472C4;
        letter-spacing:.75pt;
        font-style:italic;}
span.NoSpacingChar
        {mso-style-name:"No Spacing Char";
        mso-style-priority:1;
        mso-style-link:"No Spacing";}
span.QuoteChar
        {mso-style-name:"Quote Char";
        mso-style-priority:29;
        mso-style-link:Quote;
        color:black;
        font-style:italic;}
span.IntenseQuoteChar
        {mso-style-name:"Intense Quote Char";
        mso-style-priority:30;
        mso-style-link:"Intense Quote";
        color:#4472C4;
        font-weight:bold;
        font-style:italic;}
p.m-2564694115631033734msolistparagraph, li.m-2564694115631033734msolistparagraph, div.m-2564694115631033734msolistparagraph
        {mso-style-name:m_-2564694115631033734msolistparagraph;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Courier;}
span.EmailStyle50
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:935796170;
        mso-list-template-ids:78659010;}
@list l1
        {mso-list-id:2119636005;
        mso-list-template-ids:542039178;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:36.0pt"><b><span style="font-family:Calibri;color:black">From:
</span></b><span style="font-family:Calibri;color:black">"Yujun Zhang (ZTE)" <zhangyujun+zte@gmail.com><br>
<b>Date: </b>Thursday, 11 January 2018 at 10:52<br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">I have almost understood it thanks to your explanation.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal">[Ifat] I liked the “almost” ;-)<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">The confusion is mainly caused by the naming. I guess the main reason is that the scope evolves but the naming is not updated with it.
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">For example<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span>`vitrage_aggregated_state` actually applies for both resource state and alarm severity as defined in `value_properties`. So `vitrage_aggregated_values` could be a better name.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[Ifat] For alarms we use ‘vitrage_aggregated_severity’<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span>For data source in static configuration, we may use `static.yaml` as a fallback. The name `default.yaml` will mislead user that it should be applied to data source configured in "types" but without a values configuration.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[Ifat] We should decide whether we want the default values to apply also to “real” datasources. I think the risk is that people who write a new datasource will forget to add the
 values yaml file, and will believe that everything works fine with the default. Then, upon a specific failure (that doesn’t happen often) they will get UNDEFINED status. On the other hand, if they always get UNDEFINED, they will remember to add the correct
 yaml file.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span>The UNDEFINED value is named UNDEFINED_DATASOURCE = "undefined datasource", it is not a consistent type of severity and state enumeration.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[Ifat] I didn’t understand this comment.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span style="mso-list:Ignore">4.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span>The behavior for data source defined in static without values configuration and data source defined in "types" without values configuration are inconsistent. The former will fallback to `default.yaml` but the latter
 will lead to undefined value.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[Ifat] See my answer to #2.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">I know it is there for historical reasons and current developers may already get used to it, but it gives new contributors too many surprises.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">What do you think? Shall we amend them?<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">On Tue, Jan 9, 2018 at 11:29 PM Afek, Ifat (Nokia - IL/Kfar Sava) <<a href="mailto:ifat.afek@nokia.com">ifat.afek@nokia.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">Hi,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">I agree that the code is confusing…</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">This is part of a change that was made in order to support default states for static entities. For example, in the static configuration yaml file you can add entities of types ‘switch’ and ‘br-ex’. In the past,
 in order to support states for these new types, you needed to add switch.yaml and br-ex.yaml under /etc/vitrage/datasources_values, which you would most likely copy&paste from another datasource. Now, we have under /etc/vitrage/datasources_values a default.yaml
 file that is used for all static entities.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">Back to the code, I believe this is the logic:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="m-2564694115631033734msolistparagraph" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:Symbol">·</span><span style="font-size:7.0pt">        
</span><span style="font-size:11.0pt;font-family:Calibri">If the datasource is part of ‘types’ (as defined in vitrage.conf) and has states configuration – use it. This is the normal behavior.</span><o:p></o:p></p>
<p class="m-2564694115631033734msolistparagraph" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:Symbol">·</span><span style="font-size:7.0pt">        
</span><span style="font-size:11.0pt;font-family:Calibri">If the datasource is not part of ‘types’, we understand that it was defined in a static configuration file. Use the default states configuration. I assume that it is somehow handled in the first part
 of the if statement (I’m not so familiar with that code)</span><o:p></o:p></p>
<p class="m-2564694115631033734msolistparagraph" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:Symbol">·</span><span style="font-size:7.0pt">        
</span><span style="font-size:11.0pt;font-family:Calibri">If neither is true – it means that the datasource is “real” and not static, and was defined in vitrage.conf types. And it also means that its states configuration is missing, so the state is UNDEFINED.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">And to your questions:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span><span style="font-size:11.0pt;font-family:Calibri">the data source is not defined -> the default states should be used</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span><span style="font-size:11.0pt;font-family:Calibri">data source defined but state config not exist -> UNDEFINED state</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span dir="LTR"></span><span style="font-size:11.0pt;font-family:Calibri">data source defined, state config exist but the state is not found. -> I believe that somewhere in the first part of the if statement you will get UNDEFINED</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">Hope that’s more clear now. It might be a good idea to add some comments to that function…</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">Best Regards,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri">Ifat.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-size:11.0pt;font-family:Calibri"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<b><span style="font-family:Calibri;color:black">From: </span></b><span style="font-family:Calibri;color:black">"Yujun Zhang (ZTE)" <<a href="mailto:zhangyujun%2Bzte@gmail.com" target="_blank">zhangyujun+zte@gmail.com</a>><br>
<b>Reply-To: </b>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<b>Date: </b>Tuesday, 9 January 2018 at 8:34<br>
<b>To: </b>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<b>Subject: </b>Re: [openstack-dev] [vitrage] rules in vitrage_aggregated_state()</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Forgot to paste the link to the related code:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<a href="https://git.openstack.org/cgit/openstack/vitrage/tree/vitrage/entity_graph/mappings/datasource_info_mapper.py#n61" target="_blank">https://git.openstack.org/cgit/openstack/vitrage/tree/vitrage/entity_graph/mappings/datasource_info_mapper.py#n61</a>
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
On Tue, Jan 9, 2018 at 2:34 PM Yujun Zhang (ZTE) <<a href="mailto:zhangyujun%2Bzte@gmail.com" target="_blank">zhangyujun+zte@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Hi root causers <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
I have been inspecting the code about aggregated state recently and have a question regarding the rules.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
 <o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<pre style="margin-left:36.0pt"><code>        if datasource_name in self.datasources_state_confs or \</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>                datasource_name <b>not</b> in self.conf.datasources.types:            ...</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>        else:</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>            self.category_normalizer[vitrage_category].set_aggregated_value(</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>                new_vertex, self.UNDEFINED_DATASOURCE)</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>            self.category_normalizer[vitrage_category].set_operational_value(</code><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><code>                new_vertex, self.UNDEFINED_DATASOURCE)</code><o:p></o:p></pre>
<div>
<pre style="margin-left:36.0pt"><span style="font-size:12.0pt;font-family:Helvetica"><br>There are some test case describing the expected behavior. But I couldn't understand the design philosophy behind it. What is expected when </span><o:p></o:p></pre>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<pre style="margin-left:72.0pt"><span style="font-size:12.0pt;font-family:Helvetica">1.</span><span style="font-size:7.0pt;font-family:"Times New Roman"">   </span><span style="font-size:12.0pt;font-family:Helvetica">the data source is not defined</span><o:p></o:p></pre>
<pre style="margin-left:72.0pt"><span style="font-size:12.0pt;font-family:Helvetica">2.</span><span style="font-size:7.0pt;font-family:"Times New Roman"">   </span><span style="font-size:12.0pt;font-family:Helvetica">data source defined but state config not exist</span><o:p></o:p></pre>
<pre style="margin-left:72.0pt"><span style="font-size:12.0pt;font-family:Helvetica">3.</span><span style="font-size:7.0pt;font-family:"Times New Roman"">   </span><span style="font-size:12.0pt;font-family:Helvetica">data source defined, state config exist but the state is not found.</span><o:p></o:p></pre>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<pre style="margin-left:36.0pt"><span style="font-size:12.0pt;font-family:Helvetica">Could somebody shed some light on it?</span><o:p></o:p></pre>
</div>
<div>
<pre style="margin-left:36.0pt"><span style="font-size:12.0pt;font-family:Helvetica"> </span><o:p></o:p></pre>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Yujun Zhang<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<br clear="all">
<br>
-- <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Yujun Zhang<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">Yujun Zhang<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>