<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:57:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-6099] DLC: YAML output must adhere to parsing rules</title>
                <link>https://jira.whamcloud.com/browse/LU-6099</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;when CPT parameter is included in YAML output, the value should be enclosed in double quotes (&quot;).&lt;/p&gt;

&lt;p&gt;Currently&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;net:
    - net: lo
      nid: 0@lo
      status: up
      tunables:
          peer_timeout: 0
          peer_credits: 0
          peer_buffer_credits: 0
          credits: 0
          CPT: [0,0]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;should be&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;net:
    - net: lo
      nid: 0@lo
      status: up
      tunables:
          peer_timeout: 0
          peer_credits: 0
          peer_buffer_credits: 0
          credits: 0
          CPT: &quot;[0,0]&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="28104">LU-6099</key>
            <summary>DLC: YAML output must adhere to parsing rules</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="ashehata">Amir Shehata</assignee>
                                    <reporter username="ashehata">Amir Shehata</reporter>
                        <labels>
                            <label>HB</label>
                    </labels>
                <created>Fri, 9 Jan 2015 00:49:44 +0000</created>
                <updated>Thu, 12 Feb 2015 00:46:24 +0000</updated>
                            <resolved>Mon, 12 Jan 2015 18:50:12 +0000</resolved>
                                                    <fixVersion>Lustre 2.7.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="102951" author="gerrit" created="Fri, 9 Jan 2015 02:09:14 +0000"  >&lt;p&gt;Amir Shehata (amir.shehata@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/13304&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13304&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6099&quot; title=&quot;DLC: YAML output must adhere to parsing rules&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6099&quot;&gt;&lt;del&gt;LU-6099&lt;/del&gt;&lt;/a&gt; lnet: correct YAML output&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 71abe659e67129280c8ec58c2782dcb6b1fb86d5&lt;/p&gt;</comment>
                            <comment id="103029" author="simmonsja" created="Fri, 9 Jan 2015 17:29:02 +0000"  >&lt;p&gt;Patch fixes the issue.&lt;/p&gt;</comment>
                            <comment id="103219" author="gerrit" created="Mon, 12 Jan 2015 18:46:03 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/13304/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13304/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6099&quot; title=&quot;DLC: YAML output must adhere to parsing rules&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6099&quot;&gt;&lt;del&gt;LU-6099&lt;/del&gt;&lt;/a&gt; lnet: correct YAML output&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 53cc2a1fe6befcd51826a9b42e8dff9cc33ee8a3&lt;/p&gt;</comment>
                            <comment id="103220" author="jlevi" created="Mon, 12 Jan 2015 18:50:12 +0000"  >&lt;p&gt;Patch landed to Master.&lt;/p&gt;</comment>
                            <comment id="103239" author="fzago" created="Mon, 12 Jan 2015 19:52:27 +0000"  >&lt;p&gt;I&apos;m not affected by this, but that fix looks strange. It changes CPT from being an array to being a string. Is there any external tool parsing these files too? Because they&apos;re likely to break on that new input.&lt;/p&gt;

&lt;p&gt;Here&apos;s for instance how python decodes the test file before and after:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;{&apos;net&apos;: [{&apos;status&apos;: &apos;up&apos;, &apos;tunables&apos;: {&apos;peer_timeout&apos;: 0, &apos;credits&apos;: 0, &apos;CPT&apos;: [0, 0], ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;{&apos;net&apos;: [{&apos;status&apos;: &apos;up&apos;, &apos;tunables&apos;: {&apos;peer_timeout&apos;: 0, &apos;credits&apos;: 0, &apos;CPT&apos;: &apos;[0,0]&apos;, ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="106557" author="morrone" created="Wed, 11 Feb 2015 00:01:17 +0000"  >&lt;p&gt;I agree with Frank, that seems like an odd choice to me.&lt;/p&gt;</comment>
                            <comment id="106713" author="ashehata" created="Wed, 11 Feb 2015 22:53:09 +0000"  >&lt;p&gt;There is no existing external tools that parse that output.  So there is no backwards compatibility issue.&lt;/p&gt;

&lt;p&gt;the problem as I have explained in the patch is that the yaml 3rd party library that we use does not parse input such as &lt;span class=&quot;error&quot;&gt;&amp;#91;0,1...&amp;#93;&lt;/span&gt;.  It has to be enclosed in double quotes.  This causes a problem since the output can be without the double quotes, but if you take that output and try to pipe it into lnetctl again (ex: lnetctl import &amp;lt; config.yaml), it&apos;ll have a parse error.  &lt;/p&gt;

&lt;p&gt;The requirement that the lnetclt export output has to be usable with lnetctl import, is higher priority than having the CPT parameter as parsable from python.  Therefore the above solution was implemented.&lt;/p&gt;

&lt;p&gt;Another possible solution is to simply have the output as: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CPT: 0,1,2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, that would parse in python as a string as well.  So, you&apos;ll end up with the same issue.&lt;/p&gt;

&lt;p&gt;An easy way to deal with this is simply to parse out the CPT output into a list as below&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;YAML output:

net:
    - net: tcp
      nid: 192.168.205.158@tcp
      status: up
      interfaces:
          0: eth4
      tunables:
          peer_timeout: 180
          peer_credits: 8
          peer_buffer_credits: 0
          clnetredits: 256
      CPT: &lt;span class=&quot;code-quote&quot;&gt;&quot;[1,0]&quot;&lt;/span&gt;

Python Interpetation:

{&lt;span class=&quot;code-quote&quot;&gt;&apos;net&apos;&lt;/span&gt;: [{&lt;span class=&quot;code-quote&quot;&gt;&apos;CPT&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;[1,0]&apos;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&apos;interfaces&apos;&lt;/span&gt;: {0: &lt;span class=&quot;code-quote&quot;&gt;&apos;eth4&apos;&lt;/span&gt;},
          &lt;span class=&quot;code-quote&quot;&gt;&apos;net&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;tcp&apos;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&apos;nid&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;192.168.205.158@tcp&apos;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&apos;status&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;up&apos;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&apos;tunables&apos;&lt;/span&gt;: {&lt;span class=&quot;code-quote&quot;&gt;&apos;clnetredits&apos;&lt;/span&gt;: 256,
                       &lt;span class=&quot;code-quote&quot;&gt;&apos;peer_buffer_credits&apos;&lt;/span&gt;: 0,
                       &lt;span class=&quot;code-quote&quot;&gt;&apos;peer_credits&apos;&lt;/span&gt;: 8,
                       &lt;span class=&quot;code-quote&quot;&gt;&apos;peer_timeout&apos;&lt;/span&gt;: 180}}]}

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we assign the above python expression to a variable x, then you can &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; the following
cpt_list = x[&lt;span class=&quot;code-quote&quot;&gt;&apos;net&apos;&lt;/span&gt;][0][&lt;span class=&quot;code-quote&quot;&gt;&apos;CPT&apos;&lt;/span&gt;].replace(&lt;span class=&quot;code-quote&quot;&gt;&apos;[&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;&apos;).replace(&apos;&lt;/span&gt;]&lt;span class=&quot;code-quote&quot;&gt;&apos;, &apos;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;).split(&apos;&lt;/span&gt;,&apos;)

then you can print items in the list by:

&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(cpt_list[0])

You can also create a loop
&amp;gt;&amp;gt;&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; item in cpt_list:
...     print &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(item)

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you have a better solution please share it.&lt;/p&gt;</comment>
                            <comment id="106715" author="fzago" created="Wed, 11 Feb 2015 23:00:01 +0000"  >&lt;p&gt;What about this?&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;  CPT: 
    - 0
    - 1
    - 2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="106729" author="ashehata" created="Thu, 12 Feb 2015 00:42:40 +0000"  >&lt;p&gt;That means if you have over 10 CPTs, which I guess is entirely possible on multicore systems, you&apos;ll have something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;CPT:
  - 1
  - 2
  - 3
  - 4
  - 5
  - 6
  - 7
  - 8
  - 9
  - 10
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With larger number of CPTs, the output would be fairly large.  It does give you the advantage of being converted into a python list, but the disadvantage is that you&apos;ll have fairly large output. And there will be no way to express a CPU range.  For example &quot;CPT: &quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-4&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;

&lt;p&gt;Due to these reasons, I believe that the current solution advantages, outweigh the disadvantages.&lt;/p&gt;</comment>
                            <comment id="106731" author="fzago" created="Thu, 12 Feb 2015 00:46:24 +0000"  >&lt;p&gt;I see. Sorry, it appeared to me that CPT was a list/array (and valid YAML). If it&apos;s not, then yes, using quotes is fine. The application just has to parse the string.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="27962">LU-6043</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10070" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Project</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10042"><![CDATA[Dynamic LNET Configuration]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzx3in:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16975</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>