<?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 Try Except Final Block - Restconf PY Script in Code Exchange</title>
    <link>https://community.cisco.com/t5/code-exchange/try-except-final-block-restconf-py-script/m-p/5223391#M132</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;When running the attached script, I am running in the following issues:&lt;/P&gt;&lt;P&gt;response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)&lt;BR /&gt;NameError: name 'headers' is not defined&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Traceback:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NameError: name 'headers' is not defined&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;During handling of the above exception, another exception occurred:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; File "/***/TryExecptFinallyRequestsRestconf-TS.py", line 21, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; with open(filename, 'a') as f:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NameError: name 'filename' is not defined&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 18:57:12 GMT</pubDate>
    <dc:creator>Netmart</dc:creator>
    <dc:date>2024-11-12T18:57:12Z</dc:date>
    <item>
      <title>Try Except Final Block - Restconf PY Script</title>
      <link>https://community.cisco.com/t5/code-exchange/try-except-final-block-restconf-py-script/m-p/5223391#M132</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;When running the attached script, I am running in the following issues:&lt;/P&gt;&lt;P&gt;response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)&lt;BR /&gt;NameError: name 'headers' is not defined&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Traceback:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NameError: name 'headers' is not defined&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;During handling of the above exception, another exception occurred:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; File "/***/TryExecptFinallyRequestsRestconf-TS.py", line 21, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; with open(filename, 'a') as f:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NameError: name 'filename' is not defined&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 18:57:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/code-exchange/try-except-final-block-restconf-py-script/m-p/5223391#M132</guid>
      <dc:creator>Netmart</dc:creator>
      <dc:date>2024-11-12T18:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Try Except Final Block - Restconf PY Script</title>
      <link>https://community.cisco.com/t5/code-exchange/try-except-final-block-restconf-py-script/m-p/5223404#M133</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/244740"&gt;@Netmart&lt;/a&gt;&amp;nbsp;your&amp;nbsp;&lt;SPAN&gt;errors are being seen in your script indicate that the variables &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;are not defined before they are used.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 19:26:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/code-exchange/try-except-final-block-restconf-py-script/m-p/5223404#M133</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-11-12T19:26:44Z</dc:date>
    </item>
  </channel>
</rss>

