Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

emit_warning() Function (Python)

date_range 30-May-23

Syntax

Python Syntax

content_copy zoom_out_map
jcs.emit_warning(string)

Description

Generate a warning message on the console from a Python automation script. The warning message is preceded by the text warning: .

Note:

If the jcs.emit_warning string argument includes a null character sequence (\0), the script generates an Invalid number of arguments error. Additionally, if the string argument consists exclusively of an empty string or escape sequences (\n \t \b \v \f \r) and spaces, Junos OS does not emit any message.

Parameters

string

String describing the warning.

Usage Examples

content_copy zoom_out_map
import jcs

def main():
    ...
    jcs.emit_warning("Warning message from a Python automation script")

if __name__ == '__main__':
    main()

Release Information

Function introduced in Junos OS Release 16.1R1.

footer-navigation