Python: Creating upm profile with script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-04-2017 03:09 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-06-2017 03:00 PM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-05-2017 10:02 PM
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?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-05-2017 04:29 PM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-05-2017 09:01 AM
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
Getting the following error message when trying to run the script.
Traceback (most recent call last): File "/config/upmTest.py", line 3, in
