<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:56:23 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>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[CONTROLLER-1758] Class FileModuleShardConfigProvider does not load configurations from classpath properly</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-1758</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;Loading configurations from classpath in class FileModuleShardConfigProvider &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; does not work properly, because it tries to read from file name instead of file path.&lt;/p&gt;

&lt;p&gt;This is code that read configs:&lt;/p&gt;

&lt;p&gt;        Config moduleShardsConfig = null;&lt;br/&gt;
        if (moduleShardsFile.exists()) &lt;/p&gt;
{
            LOG.info(&quot;module shards config file exists - reading config from it&quot;);
            moduleShardsConfig = ConfigFactory.parseFile(moduleShardsFile);
        } else {
            LOG.warn(&quot;module shards configuration read from resource&quot;);
            moduleShardsConfig = ConfigFactory.load(moduleShardsFile.getName()); // &amp;lt;-------------------
        }&lt;br/&gt;
&lt;br/&gt;
        Config modulesConfig = null;&lt;br/&gt;
        if (modulesFile.exists()) {
            LOG.info(&quot;modules config file exists - reading config from it&quot;);
            modulesConfig = ConfigFactory.parseFile(modulesFile);
        } else {
            LOG.warn(&quot;modules configuration read from resource&quot;);
            modulesConfig = ConfigFactory.load(modulesFile.getName()); // &amp;lt;-------------------
        }&lt;br/&gt;
&lt;br/&gt;
And it should look something like this:&lt;br/&gt;
&lt;br/&gt;
        Config moduleShardsConfig = null;&lt;br/&gt;
        if (moduleShardsFile.exists()) {            LOG.info(&quot;module shards config file exists - reading config from it&quot;);            moduleShardsConfig = ConfigFactory.parseFile(moduleShardsFile);        }
&lt;p&gt; else &lt;/p&gt;
{
            LOG.warn(&quot;module shards configuration read from resource&quot;);
            final String path = moduleShardsFile.getPath().replace(&quot;\\&quot;, &quot;/&quot;); // in case of windows OS
            moduleShardsConfig = ConfigFactory.load(path);
        }

&lt;p&gt;        Config modulesConfig = null;&lt;br/&gt;
        if (modulesFile.exists()) &lt;/p&gt;
{
            LOG.info(&quot;modules config file exists - reading config from it&quot;);
            modulesConfig = ConfigFactory.parseFile(modulesFile);
        }
&lt;p&gt; else &lt;/p&gt;
{
            LOG.warn(&quot;modules configuration read from resource&quot;);
            final String path = modulesFile.getPath().replace(&quot;\\&quot;, &quot;/&quot;); // in case of windows OS
            modulesConfig = ConfigFactory.load(path);
        }


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; - org.opendaylight.controller.cluster.datastore.config.FileModuleShardConfigProvider&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="26312">CONTROLLER-1758</key>
            <summary>Class FileModuleShardConfigProvider does not load configurations from classpath properly</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/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="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="jakubtoth-0">Jakub Toth</assignee>
                                    <reporter username="samuel.kontris">Samuel Kontris</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Aug 2017 14:20:59 +0000</created>
                <updated>Tue, 25 Jul 2023 08:24:46 +0000</updated>
                            <resolved>Mon, 4 Sep 2017 21:27:09 +0000</resolved>
                                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="52636" author="jatoth@cisco.com" created="Wed, 30 Aug 2017 11:01:26 +0000"  >&lt;p&gt;In this way, we don&apos;t need to use replace method on getPath() because the resulting string uses the system-dependent default name-separator character to separate the names. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is &apos;/&apos;; on Microsoft Windows systems it is &apos;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&apos;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/62439/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/62439/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="52637" author="juraj.veverka@pantheon.tech" created="Mon, 4 Sep 2017 14:18:18 +0000"  >&lt;p&gt;(In reply to Jakub Toth from comment #1)&lt;br/&gt;
&amp;gt; In this way, we don&apos;t need to use replace method on getPath() because the&lt;br/&gt;
&amp;gt; resulting string uses the system-dependent default name-separator character&lt;br/&gt;
&amp;gt; to separate the names. This field is initialized to contain the first&lt;br/&gt;
&amp;gt; character of the value of the system property file.separator. On UNIX&lt;br/&gt;
&amp;gt; systems the value of this field is &apos;/&apos;; on Microsoft Windows systems it is&lt;br/&gt;
&amp;gt; &apos;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&apos;.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/62439/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/62439/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this is true, but in this case is file path used as classpath and on systems with File.separator != &apos;/&apos; this code will never work.&lt;br/&gt;
to avoid character replacements, you can use string paths directly like this:&lt;/p&gt;

&lt;p&gt;moduleShardsConfig = ConfigFactory.load(moduleShardsConfigPath);&lt;br/&gt;
modulesConfig = ConfigFactory.load(modulesConfigPath);&lt;/p&gt;

&lt;p&gt;original strings are private members of FileModuleShardConfigProvider class.&lt;/p&gt;</comment>
                            <comment id="52638" author="jatoth@cisco.com" created="Mon, 4 Sep 2017 15:39:22 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/62634&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/62634&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9056</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=9056]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i02sjr:</customfieldvalue>

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