<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Passing deviation files to ydk-cpp in the bundle in Tools</title>
    <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4446793#M1327</link>
    <description>&lt;P&gt;The deviation files provide only certain and limited alterations for the YANG modules and therefore they do not affect model API. The deviation files listed in capabilities are loaded by YDK in runtime when corresponding modules are loaded to memory (performed by libyang).&lt;/P&gt;</description>
    <pubDate>Mon, 09 Aug 2021 22:23:32 GMT</pubDate>
    <dc:creator>yangorelik</dc:creator>
    <dc:date>2021-08-09T22:23:32Z</dc:date>
    <item>
      <title>Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4444606#M1326</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the ydk-cpp (generate.py -cpp) with --bundle option to generate the CPP files from yang. I have a few deviation files that need to be passed for different yang files. Is there a way to pass this information as part of the bundle json file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have the capability to pass multiple deviation yang files for a specific target yang file.&lt;/P&gt;&lt;P&gt;It would be of great help if any links to documentation or the steps involved to achieve the above are provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 03:58:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4444606#M1326</guid>
      <dc:creator>akpramod</dc:creator>
      <dc:date>2021-08-05T03:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4446793#M1327</link>
      <description>&lt;P&gt;The deviation files provide only certain and limited alterations for the YANG modules and therefore they do not affect model API. The deviation files listed in capabilities are loaded by YDK in runtime when corresponding modules are loaded to memory (performed by libyang).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:23:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4446793#M1327</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2021-08-09T22:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4446837#M1328</link>
      <description>&lt;P&gt;Thanks Yan for your reply - We have a scenario where one configuration node is deviated as "not-supported" using a deviation like below.&lt;/P&gt;&lt;PRE&gt;deviation /system:system/card:attributes/card:label
{
  deviate not-supported;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, in the generated .hpp file we still have the YLeaf present.&lt;/P&gt;&lt;PRE&gt;ydk::YLeaf label; //type: uint32&lt;/PRE&gt;&lt;P&gt;We want to know if the deviation files could be used while generating the header files and source files to remove the 'not-supported' attributes, since pyang can take deviation files as input for a particular module and apply the deviations.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 03:33:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4446837#M1328</guid>
      <dc:creator>akpramod</dc:creator>
      <dc:date>2021-08-10T03:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4447269#M1329</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1231156"&gt;@akpramod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the early YDK development days (&amp;lt;=0.5.5) the deviation files were considered while generating model API. But since 0.6.0 the deviation files are not included to bundle profiles for two reasons:&lt;/P&gt;&lt;P&gt;1. The module files considered to be more stable than their deviations. For example IETF or openconfig standard models are used in multiple vendors applications, while some features in particular implementations might not be supported or slightly changed (ex.: value restrictions).&lt;/P&gt;&lt;P&gt;2. Since 0.6.0 the YANG model processing is implemented in &lt;EM&gt;libyang&lt;/EM&gt; library code. When deviations applied, the corresponding files are loaded and corresponding changes applied accordingly.&lt;/P&gt;&lt;P&gt;In your case the leaf &lt;EM&gt;label&lt;/EM&gt; is present in the model API. But if application developer tries to use it in the presence of deviation, which states that it is not supported, then the &lt;EM&gt;libyang&lt;/EM&gt; will reject it and return an error indicating that this leaf is deprecated.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 15:53:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4447269#M1329</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2021-08-13T15:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4448184#M1330</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are using following json file to generate the cpp files.&amp;nbsp; Please find the attached sample yang files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "name": "test",
  "version": "1.0.0",
  "core_version": "1.0.0",
  "author": "Auto Generated",
  "copyright": "XYZ",
  "description": "Profile generated test",
  "models": {
    "file": [
      "yang/test.yang",
      "yang/aug_test.yang",
      "yang/dev_test.yang"
    ]
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;generate.py -cpp --output-directory /out --bundle test.json&lt;/P&gt;&lt;P&gt;YDK version :&amp;nbsp;YDK-0.8.4&lt;/P&gt;&lt;P&gt;we are still seeing the leaf label and aug_label in the generated cpp files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 05:57:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4448184#M1330</guid>
      <dc:creator>JohnGeorge31733</dc:creator>
      <dc:date>2021-08-12T05:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4449198#M1331</link>
      <description>&lt;P&gt;Hi John and&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1231156"&gt;@akpramod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for misleading you, I have corrected my previous post. This is correct YDK behavior by design. As stated previously, all deviation statements are ignored during bundle generation. The deviations applied to the YANG models during runtime when corresponding files are loaded into &lt;EM&gt;libyang&lt;/EM&gt; memory. If user then tries to use the deviated node in other way than it is defined in the deviation statement, the YDK will develop a &lt;EM&gt;YModelError&lt;/EM&gt; exception.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 16:13:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4449198#M1331</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2021-08-13T16:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4449417#M1332</link>
      <description>&lt;P&gt;Thanks Yan for the clarification ,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;If we are using the YDK only for generation of CPP header/source files and not at run time, could we comment the following lines so that the deviation file changes are reflected in the generated model files?&lt;/DIV&gt;&lt;DIV&gt;ydkgen/builder/_pyang_model_builder.py (line no: 50, 51, 52&amp;nbsp; &amp;nbsp; under "def parse_and_return_modules(self):")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;statements.add_validation_fun('reference_3', ['deviation'], self._add_i_deviation)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; statements.add_validation_fun('reference_3', ['deviation'], self._add_d_info)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; statements.add_validation_fun('reference_3', ['deviate'], self._remove_d_info)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 14 Aug 2021 07:05:49 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4449417#M1332</guid>
      <dc:creator>JohnGeorge31733</dc:creator>
      <dc:date>2021-08-14T07:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Passing deviation files to ydk-cpp in the bundle</title>
      <link>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4450008#M1333</link>
      <description>&lt;P&gt;Hi John&lt;/P&gt;&lt;P&gt;YDK is open source project&amp;nbsp;under the Apache License, Version 2.0. That mean you can create your own fork and make any changes in the source code. If the above code changes work for you, then please go ahead. If you are going to publish the changes, then you need to make a contribution comment notes in all the affected files.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 15:51:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/passing-deviation-files-to-ydk-cpp-in-the-bundle/m-p/4450008#M1333</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2021-08-16T15:51:22Z</dc:date>
    </item>
  </channel>
</rss>

