cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
403
Views
0
Helpful
1
Replies

Try Except Final Block - Restconf PY Script

Netmart
Level 3
Level 3

Hello,

When running the attached script, I am running in the following issues:

response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)
NameError: name 'headers' is not defined

During handling of the above exception, another exception occurred:

Traceback:

    response = requests.get(ip + dn, headers=headers, auth=auth, verify=false)
NameError: name 'headers' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/***/TryExecptFinallyRequestsRestconf-TS.py", line 21, in <module>
    with open(filename, 'a') as f:
NameError: name 'filename' is not defined
 
Thanks.

 

1 Accepted Solution

Accepted Solutions

@Netmart your errors are being seen in your script indicate that the variables  are not defined before they are used.

Hope this helps.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

1 Reply 1

@Netmart your errors are being seen in your script indicate that the variables  are not defined before they are used.

Hope this helps.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io