<?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: openconfig-isis validation error in Tools</title>
    <link>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3755557#M2180</link>
    <description>It is currently an issue in OpenConfig models.  See &lt;A href="https://github.com/openconfig/public/issues/44" target="_blank"&gt;https://github.com/openconfig/public/issues/44&lt;/A&gt;</description>
    <pubDate>Fri, 30 Nov 2018 00:21:15 GMT</pubDate>
    <dc:creator>saalvare</dc:creator>
    <dc:date>2018-11-30T00:21:15Z</dc:date>
    <item>
      <title>openconfig-isis validation error</title>
      <link>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3753177#M2179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While trying to encode the openconfig-network-instance, seeing a weird validation error where it fails for system-id, area-address and basically all net-ids.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;network_instances = openconfig_network_instance.NetworkInstances()
network_instance = network_instances.NetworkInstance()
network_instance.name = "default"
protocol = network_instance.protocols.Protocol()
protocol.identifier = openconfig_policy_types.ISIS()
protocol.name = "65444"
isis = protocol.Isis()
interface = isis.interfaces.Interface()
interface.interface_id = "HundredGigE0/0/0/0"
level = interface.levels.Level()
level.level_number = 2
adjacency = level.adjacencies.Adjacency()
adjacency.system_id = "0143.0438.AeF0"

adjacency.state.neighbor_ipv4_address = "2.1.1.1"
adjacency.state.neighbor_ipv6_address = "2001::1"
adjacency.state.up_time = YFilter.read
adjacency.state.multi_topology = False
adjacency.state.neighbor_snpa = "00:01:02:03:04:05"
level.adjacencies.adjacency.append(adjacency)
interface.levels.level.append(level)
protocol.isis.interfaces.interface.append(interface)
network_instance.protocols.protocol.append(protocol)
network_instances.network_instance.append(network_instance)
output = codec_service.encode(codec_service_provider,network_instances)
print(output)

&lt;/PRE&gt;
&lt;P&gt;Error&lt;/P&gt;
&lt;PRE&gt;YModelError:  Value "0143.0438.AeF0" does not satisfy the constraint "^[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}$" (range, length, or pattern). Path: /openconfig-network-instance:network-instances/network-instance[name='default']/protocols/protocol[identifier='openconfig-policy-types:ISIS'][name='65444']/isis/interfaces/interface[interface-id='HundredGigE0/0/0/0']/levels/level[level-number='2']/adjacencies/adjacency[system-id='0143.0438.AeF0']/system-id&lt;/PRE&gt;
&lt;P&gt;The above system-id value does match the regex given in the openconfig model but fails while doing an encoding to json and raises a model error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 00:36:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3753177#M2179</guid>
      <dc:creator>mufaddal.presswala</dc:creator>
      <dc:date>2018-11-27T00:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: openconfig-isis validation error</title>
      <link>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3755557#M2180</link>
      <description>It is currently an issue in OpenConfig models.  See &lt;A href="https://github.com/openconfig/public/issues/44" target="_blank"&gt;https://github.com/openconfig/public/issues/44&lt;/A&gt;</description>
      <pubDate>Fri, 30 Nov 2018 00:21:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3755557#M2180</guid>
      <dc:creator>saalvare</dc:creator>
      <dc:date>2018-11-30T00:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: openconfig-isis validation error</title>
      <link>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3755736#M2181</link>
      <description>&lt;P&gt;Thank you for answering the question, will follow up there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realized there is a regex problem but couldn't pin point where exactly things are going wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If its not too much to ask, let me bother you with one more query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at the model classes, there are no files with types for validation, so how does ydk-py does the validation ? Does it pick up the types,patterns directly from the yang file while validating the leaf values ? I tried going through the code but lost track after going through the below function:&lt;/P&gt;
&lt;PRE&gt;def _validate_value(leaf_tuple, name, value, logger):
    if not isinstance(leaf_tuple, tuple):
        return
    if isinstance(value, _YFilter):
        return
    typs = leaf_tuple[1]
    for typ in typs:
        if _is_identity(typ):
            if _validate_identity_value_object(typ, value):
                return
        elif _is_enum(typ):
            if _validate_enum_value_object(typ, value):
                return
        else:
            if _validate_other_type_value_object(typ, value):
                return
    err_msg = "Invalid value {0} for '{1}'. Got type: '{2}'. Expected types: {3}".format(value, name,
                                                                                         type(value).__name__,
                                                                                         _get_types_string(typs))&lt;BR /&gt;&lt;BR /&gt;def _validate_identity_value_object(typ, value):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not _is_identity(typ):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return False&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mod = importlib.import_module(typ[0])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; base_identity_class = getattr(mod, typ[1])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return isinstance(value, base_identity_class)&lt;BR /&gt;&lt;BR /&gt;def _validate_other_type_value_object(typ, value):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if typ == 'Empty':&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return isinstance(value, Empty)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if typ == 'str' and (isinstance(value, bytes) or isinstance(value, unicode)):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if typ == 'int' and (isinstance(value, int) or isinstance(value, long)):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; typ = eval(typ)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return isinstance(value, typ)&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Nov 2018 11:25:28 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3755736#M2181</guid>
      <dc:creator>mufaddal.presswala</dc:creator>
      <dc:date>2018-11-30T11:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: openconfig-isis validation error</title>
      <link>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3782372#M2182</link>
      <description>&lt;P&gt;This is known issue in openconfig Yang models, which uses non-standard string pattern regular expression. See &lt;A href="https://github.com/openconfig/public/issues/175" target="_blank"&gt;https://github.com/openconfig/public/issues/175&lt;/A&gt; for details. It is not clear for how long it is going to take for Google to fix the models, it might not happen at all. Therefore, please use Cisco native models in your application. Another option would be download openconfig models, manually fix all the pattern definitions and generate YDK bundle.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 19:43:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/openconfig-isis-validation-error/m-p/3782372#M2182</guid>
      <dc:creator>ygorelik</dc:creator>
      <dc:date>2019-01-17T19:43:00Z</dc:date>
    </item>
  </channel>
</rss>

