Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

language (Scripts)

 

Syntax

Hierarchy Level

Release Information

Statement introduced in Junos OS Release 16.1R1 on QFX Series switches and MX Series, PTX Series, and T Series routers.

Statement introduced in Junos OS Release 17.1R1 on ACX500, ACX1000, ACX1100, ACX2000, ACX2100, ACX2200, and ACX4000 routers, and EX Series switches.

Statement introduced in Junos OS Release 17.3R1 on SRX1500, SRX4100, SRX4200, SRX5400, SRX5600, and SRX5800 devices and vSRX instances.

Statement introduced in Junos OS Release 18.3R1 on ACX5048 and ACX5096 routers.

python3 option added in Junos OS Release 19.4R1 for commit, event, op, and SNMP scripts.

Description

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.

Note

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.

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 .py extension. To execute Python op scripts from a remote site, you must also configure the allow-url-for-python statement at the [edit system scripts op] hierarchy level.

Default

If you do not include the language (python | python3) statement, you cannot execute unsigned Python scripts on the device.

Options

(python | python3)Specify the Python version used to execute Python scripts. Configure python to use Python 2.7, or configure python3 to use Python 3.
Note

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. For more information, see Understanding Python Automation Scripts for Devices Running Junos OS.

Required Privilege Level

maintenance—To view this statement in the configuration.

maintenance-control—To add this statement to the configuration.