<?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 AttributeError: 'NoneType' object has no attribute 'description' in Tools</title>
    <link>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4159903#M1642</link>
    <description>&lt;P&gt;Hello again fellow developers!&lt;/P&gt;&lt;P&gt;I come to you yet again in distress and in need of an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use &lt;STRONG&gt;the model&lt;/STRONG&gt; under to retrieve interface information:&lt;/P&gt;&lt;PRE&gt;import ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg as ifmgr_cfg&lt;/PRE&gt;&lt;P&gt;The &lt;STRONG&gt;code&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;model = ifmgr_cfg.InterfaceConfigurations()
intconf = ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration()
intconf.interface_name = "TenGigE0/0/0/11.910240030"
model.interface_configuration.append(intconf)

interface = NetconfService().get(provider=getProvider(), read_filter=intconf)

print(interface.description)&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Log&lt;/STRONG&gt; output:&lt;/P&gt;&lt;PRE&gt;2020-10-01 08:02:53,323 - ydk - INFO - Executing 'get' RPC on [Cisco-IOS-XR-ifmgr-cfg:interface-configurations]
2020-10-01 08:02:53,341 - ydk - INFO - ============= Sending RPC to device =============
&amp;lt;rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;&amp;lt;get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;
  &amp;lt;filter&amp;gt;&amp;lt;interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"&amp;gt;
  &amp;lt;interface-configuration&amp;gt;
    &amp;lt;interface-name&amp;gt;TenGigE0/0/0/11.910240030&amp;lt;/interface-name&amp;gt;
  &amp;lt;/interface-configuration&amp;gt;
&amp;lt;/interface-configurations&amp;gt;&amp;lt;/filter&amp;gt;
&amp;lt;/get&amp;gt;
&amp;lt;/rpc&amp;gt;
2020-10-01 08:02:53,577 - ydk - INFO - ============= Received RPC from device =============
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"&amp;gt;
  &amp;lt;data&amp;gt;
    &amp;lt;interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"&amp;gt;
      &amp;lt;interface-configuration&amp;gt;
        &amp;lt;active&amp;gt;act&amp;lt;/active&amp;gt;
        &amp;lt;interface-name&amp;gt;TenGigE0/0/0/11.910240030&amp;lt;/interface-name&amp;gt;
        &amp;lt;interface-mode-non-physical&amp;gt;l2-transport&amp;lt;/interface-mode-non-physical&amp;gt;
        &amp;lt;description&amp;gt;MAN-CPE:FRD-ASR920-Firdavegen5-LAB:Port24&amp;lt;/description&amp;gt;
        &amp;lt;ethernet-service xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-l2-eth-infra-cfg"&amp;gt;
          &amp;lt;encapsulation&amp;gt;
            &amp;lt;outer-tag-type&amp;gt;match-dot1q&amp;lt;/outer-tag-type&amp;gt;
            &amp;lt;outer-range1-low&amp;gt;1024&amp;lt;/outer-range1-low&amp;gt;
            &amp;lt;exact/&amp;gt;
          &amp;lt;/encapsulation&amp;gt;
          &amp;lt;rewrite&amp;gt;
            &amp;lt;rewrite-type&amp;gt;pop1&amp;lt;/rewrite-type&amp;gt;
          &amp;lt;/rewrite&amp;gt;
        &amp;lt;/ethernet-service&amp;gt;
        &amp;lt;mtus&amp;gt;
          &amp;lt;mtu&amp;gt;
            &amp;lt;owner&amp;gt;sub_vlan&amp;lt;/owner&amp;gt;
            &amp;lt;mtu&amp;gt;1522&amp;lt;/mtu&amp;gt;
          &amp;lt;/mtu&amp;gt;
        &amp;lt;/mtus&amp;gt;
      &amp;lt;/interface-configuration&amp;gt;
    &amp;lt;/interface-configurations&amp;gt;
  &amp;lt;/data&amp;gt;
&amp;lt;/rpc-reply&amp;gt;&lt;/PRE&gt;&lt;P&gt;My &lt;STRONG&gt;result&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;AttributeError: 'NoneType' object has no attribute 'description'&lt;/PRE&gt;&lt;P&gt;I am following the &lt;STRONG&gt;doc&lt;/STRONG&gt; from here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://ydk.cisco.com/py/docs/gen_doc_dfe42d73c3f4f1961e486d4f23a11f136f62317a.html#ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration" target="_blank" rel="noopener"&gt;http://ydk.cisco.com/py/docs/gen_doc_dfe42d73c3f4f1961e486d4f23a11f136f62317a.html#ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mind pointing me in the direction of my mistake?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Simon Johansen&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 08:58:43 GMT</pubDate>
    <dc:creator>SimonJohansen</dc:creator>
    <dc:date>2020-10-01T08:58:43Z</dc:date>
    <item>
      <title>AttributeError: 'NoneType' object has no attribute 'description'</title>
      <link>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4159903#M1642</link>
      <description>&lt;P&gt;Hello again fellow developers!&lt;/P&gt;&lt;P&gt;I come to you yet again in distress and in need of an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use &lt;STRONG&gt;the model&lt;/STRONG&gt; under to retrieve interface information:&lt;/P&gt;&lt;PRE&gt;import ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg as ifmgr_cfg&lt;/PRE&gt;&lt;P&gt;The &lt;STRONG&gt;code&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;model = ifmgr_cfg.InterfaceConfigurations()
intconf = ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration()
intconf.interface_name = "TenGigE0/0/0/11.910240030"
model.interface_configuration.append(intconf)

interface = NetconfService().get(provider=getProvider(), read_filter=intconf)

print(interface.description)&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Log&lt;/STRONG&gt; output:&lt;/P&gt;&lt;PRE&gt;2020-10-01 08:02:53,323 - ydk - INFO - Executing 'get' RPC on [Cisco-IOS-XR-ifmgr-cfg:interface-configurations]
2020-10-01 08:02:53,341 - ydk - INFO - ============= Sending RPC to device =============
&amp;lt;rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;&amp;lt;get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;
  &amp;lt;filter&amp;gt;&amp;lt;interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"&amp;gt;
  &amp;lt;interface-configuration&amp;gt;
    &amp;lt;interface-name&amp;gt;TenGigE0/0/0/11.910240030&amp;lt;/interface-name&amp;gt;
  &amp;lt;/interface-configuration&amp;gt;
&amp;lt;/interface-configurations&amp;gt;&amp;lt;/filter&amp;gt;
&amp;lt;/get&amp;gt;
&amp;lt;/rpc&amp;gt;
2020-10-01 08:02:53,577 - ydk - INFO - ============= Received RPC from device =============
&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"&amp;gt;
  &amp;lt;data&amp;gt;
    &amp;lt;interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"&amp;gt;
      &amp;lt;interface-configuration&amp;gt;
        &amp;lt;active&amp;gt;act&amp;lt;/active&amp;gt;
        &amp;lt;interface-name&amp;gt;TenGigE0/0/0/11.910240030&amp;lt;/interface-name&amp;gt;
        &amp;lt;interface-mode-non-physical&amp;gt;l2-transport&amp;lt;/interface-mode-non-physical&amp;gt;
        &amp;lt;description&amp;gt;MAN-CPE:FRD-ASR920-Firdavegen5-LAB:Port24&amp;lt;/description&amp;gt;
        &amp;lt;ethernet-service xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-l2-eth-infra-cfg"&amp;gt;
          &amp;lt;encapsulation&amp;gt;
            &amp;lt;outer-tag-type&amp;gt;match-dot1q&amp;lt;/outer-tag-type&amp;gt;
            &amp;lt;outer-range1-low&amp;gt;1024&amp;lt;/outer-range1-low&amp;gt;
            &amp;lt;exact/&amp;gt;
          &amp;lt;/encapsulation&amp;gt;
          &amp;lt;rewrite&amp;gt;
            &amp;lt;rewrite-type&amp;gt;pop1&amp;lt;/rewrite-type&amp;gt;
          &amp;lt;/rewrite&amp;gt;
        &amp;lt;/ethernet-service&amp;gt;
        &amp;lt;mtus&amp;gt;
          &amp;lt;mtu&amp;gt;
            &amp;lt;owner&amp;gt;sub_vlan&amp;lt;/owner&amp;gt;
            &amp;lt;mtu&amp;gt;1522&amp;lt;/mtu&amp;gt;
          &amp;lt;/mtu&amp;gt;
        &amp;lt;/mtus&amp;gt;
      &amp;lt;/interface-configuration&amp;gt;
    &amp;lt;/interface-configurations&amp;gt;
  &amp;lt;/data&amp;gt;
&amp;lt;/rpc-reply&amp;gt;&lt;/PRE&gt;&lt;P&gt;My &lt;STRONG&gt;result&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;AttributeError: 'NoneType' object has no attribute 'description'&lt;/PRE&gt;&lt;P&gt;I am following the &lt;STRONG&gt;doc&lt;/STRONG&gt; from here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://ydk.cisco.com/py/docs/gen_doc_dfe42d73c3f4f1961e486d4f23a11f136f62317a.html#ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration" target="_blank" rel="noopener"&gt;http://ydk.cisco.com/py/docs/gen_doc_dfe42d73c3f4f1961e486d4f23a11f136f62317a.html#ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you mind pointing me in the direction of my mistake?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Simon Johansen&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 08:58:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4159903#M1642</guid>
      <dc:creator>SimonJohansen</dc:creator>
      <dc:date>2020-10-01T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'NoneType' object has no attribute 'description'</title>
      <link>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4160181#M1643</link>
      <description>&lt;P&gt;Hi Simon&lt;/P&gt;&lt;P&gt;The issue here is that list element &lt;EM&gt;interface-configuration&lt;/EM&gt; has two keys: &lt;EM&gt;active&lt;/EM&gt; and &lt;EM&gt;interface-name&lt;/EM&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;container interface-configurations {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;description&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;"interface configurations";&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;list interface-configuration {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;key "active interface-name";&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;description&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;"The configuration for an interface";&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Based on the device output you should have:&lt;/P&gt;&lt;PRE&gt;model = ifmgr_cfg.InterfaceConfigurations()
intconf = ifmgr_cfg.InterfaceConfigurations.InterfaceConfiguration()
intconf.interface_name = "TenGigE0/0/0/11.910240030"&lt;BR /&gt;&lt;STRONG&gt;intconf.active = 'act'&lt;/STRONG&gt;
model.interface_configuration.append(intconf)

interface = NetconfService().get(provider=getProvider(), read_filter=intconf)

print(interface.description)&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 17:21:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4160181#M1643</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-10-01T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: 'NoneType' object has no attribute 'description'</title>
      <link>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4160521#M1644</link>
      <description>&lt;P&gt;Good morning Y&lt;SPAN&gt;angorelik!&lt;BR /&gt;Yet again you come to my rescue, thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The solution you provided worked right away.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope you have a good day,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Simon Johansen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 06:43:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/attributeerror-nonetype-object-has-no-attribute-description/m-p/4160521#M1644</guid>
      <dc:creator>SimonJohansen</dc:creator>
      <dc:date>2020-10-02T06:43:22Z</dc:date>
    </item>
  </channel>
</rss>

