Statement introduced in Junos OS Release 16.1R1.
python3 option added in Junos OS Release 19.4R1 for commit, event, op, and SNMP scripts.
python3 option support for JET and YANG scripts introduced in Junos OS Release 20.2R1.
Enable the execution of unsigned Python scripts on a device running Junos OS, and specify the version of Python used to execute the scripts.
Configuring this statement enables you to execute unsigned Python commit, event, op, and SNMP automation scripts; unsigned Python action and translation scripts for custom YANG modules; and unsigned Python scripts developed using the Juniper Extension Toolkit (JET) on devices running Junos OS. To prevent the execution of unauthorized Python code, unsigned Python scripts must be owned by either the root user or a user in the Junos OS super-user login class, and only the file owner can have write permission for the file.
Starting in Junos OS Release 16.1R3, unsigned Python scripts must be owned by either root or a user in the Junos OS super-user login class, and only the file owner can have write permission for the file. Prior to Junos OS Release 16.1R3, unsigned Python scripts must be owned by the root user.
Local Python commit, event, op, and SNMP scripts must be configured
under the hierarchy level appropriate to the script type, and the
filename must include the
To execute Python op scripts from a remote site, you must configure
the allow-url-for-python statement at the [edit system
scripts op] hierarchy level.
If you do not include the language (python | python3) statement, you cannot execute unsigned Python scripts on the device.
If you configure the
language python3 statement, the device uses Python 3 to execute scripts that support
this Python version, and it uses Python 2.7 to execute scripts that
do not support Python 3 in the given Junos OS release. Starting in
Junos OS Release 20.2R1, Junos OS uses Python 3 to execute all YANG
action and translation scripts. For more information, see Understanding Python Automation Scripts for Devices Running Junos OS.
For JET scripts, you must configure the version of the statement
that corresponds to the Python version the script supports. For example,
if you configure the
language python3 statement
for a JET script that only supports Python 2.7, you will receive a
runtime error when you execute the script.
Required Privilege Level
maintenance—To view this statement in the configuration.
maintenance-control—To add this statement to the configuration.