cancel
Showing results for 
Search instead for 
Did you mean: 

Python: Creating upm profile with script

Python: Creating upm profile with script

Nikolai_Andre_E
New Contributor
I'm trying to write a python script to configure new switches and right now I'm struggling with creating UPM profiles through the script as running create upm profile [profilename] opens an interactive session, are there ways to make the python interpreter direct its output into this session or alternatively other ways to creating / editing upm profiles without calling this interactive session?
5 REPLIES 5

Nikolai_Andre_E
New Contributor
wherever we deploy new equipment we use x440-g2 switches with 21.x as well as x460-g2 where we are still using 15.7.x, we also re-deploy a significant amount of first generation x440 and x460 switches.

Due to the scale of our network ~1000 switches we're rather cautious with deploying newer firmware in production.

Unless there is some method to do this in 15.7.x I guess I'll just develop this script for 16.x and keep using our old solution until whenever we're rolling out 16.x or higher in prod.

Edit: I mean 22.x not 16.x

Matthew_Helm1
Extreme Employee
I take it back. This method is only available in 22.x. I tested it in 16.2.x and it failed similarly. Unfortunately, the X440 cannot use 22.x . Is this the ultimate platform on which you plan to use this script?

Matthew_Helm1
Extreme Employee
That method is only available in the later 16.x code. I actually have been using it in 22.x. I can revert to confirm, but you may want to upgrade to 16.1.x or 16.2.x.

Nikolai_Andre_E
New Contributor
Doesn't seem to run on my end, I'm testing on a summit x440-24t running15.7.4.2 patch1-2

Getting the following error message when trying to run the script.

Traceback (most recent call last): File "/config/upmTest.py", line 3, in p = subprocess.Popen(['/exos/bin/exsh','-n0', '-b', '-e','remote_serial'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE) File "/exos/tools/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/exos/tools/lib/python2.7/subprocess.py", line 1245, in _execute_child child_exception = pickle.loads(data) File "/exos/tools/lib/python2.7/pickle.py", line 1382, in loads return Unpickler(file).load() File "/exos/tools/lib/python2.7/pickle.py", line 858, in load dispatch[key](self) File "/exos/tools/lib/python2.7/pickle.py", line 971, in load_string self.append(rep.decode("string-escape")) LookupError: unknown encoding: string-escape

GTM-P2G8KFN