language (Scripts)
Syntax
language (python | python3);
Hierarchy Level
[edit system scripts]
Description
Enable the execution of unsigned Python scripts on Junos devices, 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 Junos devices. 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.
Starting in Junos OS Evolved Release 21.2R1, the junos-defaults
configuration group includes the language python
statement by
default.
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
.py extension. 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.
Default
If you do not include the language (python | python3)
statement, and the device
does not include the statement in the junos-defaults
configuration
group, you cannot execute unsigned Python scripts on the device.
Options
(python | python3) | Specify the Python version used to execute Python scripts. Configure If you configure the 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 |
Required Privilege Level
maintenance—To view or add this statement in the configuration.
Release Information
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 added in Junos OS
Release 20.2R1.
python3
option added in Junos OS Evolved Release 21.1R1.
python
option deprecated in Junos OS Release 21.1R1 and Junos OS
Evolved Release 22.3R1.