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

RESTCONF: Getting 409 HTTP Conflict Responses if No Delay Set in Script

EhsanVessal
Level 1
Level 1

I've built a python script that calls about 20+ methods to configure a switch. An issue I'm running into is that certain methods will return a 409 Response and not implement configurations for that specific method. The only way I've been able to get around this is to implement delays to slow down the program. While this works and I can configure my switch in one shot, it seems a bit unfortunate that I have to slow down, seems to be against the whole spirit of automation. I was wondering if there was ways to get around this without implementing delays within my program?

1 Reply 1

Alex Stevenson
Cisco Employee
Cisco Employee

 

Hello @EhsanVessal,

 

Cool stuff. Is it possible you can share your script code with us here?

 

A few option come to mind:

 

  1. Use sequencing commands built into the Python standard library, such as while and if, we can use the old-school method of chaining your processes into a functional code that executes sequentially. 
  2. Try threading to complete separate processes concurrently. I highly recommend you reading this entire tutorial Definitive Guide: Threading in Python, especially the section Thread module in Python3.
  3. I would also recommend you check out Joblib: running Python functions as pipeline jobs. Joblib is a set of tools to provide lightweight pipelining in Python. In particular: simple parallel computing

 

Hope this helps!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: