Skip to content

Remove Flask banner in http_api.py#1812

Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom
bingwang-ms:disable_flask_banner
Jun 28, 2020
Merged

Remove Flask banner in http_api.py#1812
bingwang-ms merged 1 commit intosonic-net:masterfrom
bingwang-ms:disable_flask_banner

Conversation

@bingwang-ms
Copy link
Collaborator

Description of PR

Summary:
Fixes # (issue)
Remove Flask banner in http_api.py app.run()

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Flask prints some message as banner when app.run is called, like this:

 * Serving Flask app "http_api" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off

These messages are caught by exabgp and run as command, which will produce WARN log:

Wed, 24 Jun 2020 09:11:21 | INFO     | 7397   | processes     | Command from process http-api :  * Serving Flask app "http_api" (lazy loading) 
Wed, 24 Jun 2020 09:11:21 | WARNING  | 7397   | reactor       | Command from process not understood : * Serving Flask app "http_api" ( lazy loading )
Wed, 24 Jun 2020 09:11:21 | INFO     | 7397   | processes     | Command from process http-api :  * Environment: production 
Wed, 24 Jun 2020 09:11:21 | WARNING  | 7397   | reactor       | Command from process not understood : * Environment: production
Wed, 24 Jun 2020 09:11:21 | INFO     | 7397   | processes     | Command from process http-api :    WARNING: Do not use the development server in a production environment. 
Wed, 24 Jun 2020 09:11:21 | WARNING  | 7397   | reactor       | Command from process not understood : WARNING: Do not use the development server in a production environment.
Wed, 24 Jun 2020 09:11:21 | INFO     | 7397   | processes     | Command from process http-api :    Use a production WSGI server instead. 
Wed, 24 Jun 2020 09:11:21 | WARNING  | 7397   | reactor       | Command from process not understood : Use a production WSGI server instead.
Wed, 24 Jun 2020 09:11:21 | INFO     | 7397   | processes     | Command from process http-api :  * Debug mode: off 
Wed, 24 Jun 2020 09:11:21 | WARNING  | 7397   | reactor       | Command from process not understood : * Debug mode: off

How did you do it?

Override show_server_banner method in Flask to disable banner.

How did you verify/test it?

Run test_announce_routes.py and test_bgp_speaker.py to verify exabgp works normally, and WARN message is not produced any more.

Any platform specific information?

No.

Supported testbed topology if it's a new test case?

No.

Documentation

Not related.

@bingwang-ms bingwang-ms requested a review from lguohan June 25, 2020 14:33
@wangxin
Copy link
Collaborator

wangxin commented Jun 28, 2020

retest vsimage please

@bingwang-ms bingwang-ms merged commit c67a1ab into sonic-net:master Jun 28, 2020
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
* d03ba4f [202012] [portstat, intfstat] added rates and utilization  (sonic-net#1812)
* 499ad3f [config reload] Fix config reload failure due to sonic.target job cancellation (sonic-net#1814)
* 96d658c [202012][sonic installer] Add swap setup support (sonic-net#1815)
* a9c6970 platform pre-check for reboot in 202012 branch (sonic-net#1788)
* 0e0478b Unify the number format in the ourput of portstat and pfcstat in all cases (sonic-net#1795)
* 2d1e00e [ecnconfig] Fix exception seen during display and add unit tests (#1784) (sonic-net#1789)

Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants