allow-url-for-python (Op Scripts)
Syntax
allow-url-for-python;
Hierarchy Level
[edit system scripts op]
Description
Enable the execution of Python op scripts from a remote site.
When you configure the language python
or language
python3
statement at the [edit system scripts]
hierarchy
level, you can execute local Python scripts on a device running Junos
OS. In order to execute Python op scripts from a remote site, you
must also configure the allow-url-for-python
statement.
To verify the integrity of the remote op script before it runs
on the device, you can optionally confirm the checksum hash for the
script. To determine the checksum, use the file checksum
operational mode command. When you run the op url
command
you can provide the hash value for that script by using the key
option. If the calculated and specified values do not match, script
execution fails.
Starting in Junos OS Release 18.2R2 and 18.3R1, Junos OS supports only the SHA-256 hash function for script checksum hashes. Earlier releases support the MD5, SHA-1, and SHA-256 hash functions.
The no-allow-url
statement takes precedence over
the allow-url-for-python
statement; if both statements
are configured, you cannot execute Python op scripts from a remote
site on the device.
Default
If you do not include the allow-url-for-python
statement, you cannot execute Python op scripts from a remote site,
and the op url
command generates an error.
Required Privilege Level
maintenance—To view or add this statement in the configuration.
Release Information
Statement introduced in Junos OS Release 16.1R1.