I can create files in `/var/db/scripts/`
I have both op and commit scripts in SLAX and have used some example python scripts as well.
I was looking for a way to use the interpreter because that seemed easier than trying to write and debug a script by invoking it via either `op` or `commit`
------------------------------
Andrew Gallo
------------------------------
Original Message:
Sent: 11-27-2024 12:03
From: Ethan Jackson
Subject: Python interpreter on MX (or: development environment for onbox scripts)
Hi Agallo,
Are you able to create a .py file in:
% cd /var/db/scripts/commit/
% ls
services services_evpn_commit_script.py test.py
It looks like these files can be created within the commit script shell, so this may be somewhere to look into further?
------------------------------
Ethan Jackson / ETH4N3T
Disclaimer:
I am a Juniper employee, but all opinions are my own.
Original Message:
Sent: 11-27-2024 08:13
From: agallo
Subject: Python interpreter on MX (or: development environment for onbox scripts)
Thanks, Ethan-
I have used PyEZ for some off-box scripting, but was looking for something a little easier to develop, say, a commit script, which would be easier if it was done directly on the MX.
Thanks
Original Message:
Sent: 11-27-2024 04:01
From: Ethan Jackson
Subject: Python interpreter on MX (or: development environment for onbox scripts)
Hi Agallo,
Would using Juniper PyEZ fit your needs?
- https://www.juniper.net/documentation/us/en/software/junos-pyez/junos-pyez-developer/topics/concept/junos-pyez-overview.html
------------------------------
Ethan Jackson / ETH4N3T
Disclaimer:
I am a Juniper employee, but all opinions are my own.
Original Message:
Sent: 11-25-2024 10:24
From: agallo
Subject: Python interpreter on MX (or: development environment for onbox scripts)
Greetings:
I see the Python interpreter is not available for interactive use on an MX router:
MX304-LAB-1:~ # /usr/libdata/cscript/import/python/usr/libdata/cscript/import/python: Authentication error.
Overview of Junos Automation Enhancements on Devices Running Junos OS with Enhanced Automation explains that Veriexec is disabled. There is a version of code " Junos Automation Enhancements " targeted to development environments with Veriexec disabled.
It looks like this code is only available for QFX. Any options for MX?
Or, to put another way....how do you develop on-box scripts for MX without access to the Python interpreter? Seems cumbersome to write and debug op and commit scripts without it.
Thanks