Skip to content

[sonic_py_common] Fix exception in daemon_base.py #5472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2020

Conversation

bingwang-ms
Copy link
Contributor

- Why I did it
There is a syntax error (self is missing for log_info and log_warning) in signal_handler in daemon_base.py, which causes an exception

INFO lldp#supervisord: lldpmgrd Traceback (most recent call last):
INFO lldp#supervisord: lldpmgrd   File "/usr/bin/lldpmgrd", line 224, in <module>
INFO lldp#supervisord: lldpmgrd     main()
INFO lldp#supervisord: lldpmgrd   File "/usr/bin/lldpmgrd", line 220, in main
INFO lldp#supervisord: lldpmgrd     lldpmgr.run()
INFO lldp#supervisord: lldpmgrd   File "/usr/bin/lldpmgrd", line 181, in run
INFO lldp#supervisord: lldpmgrd     (state, c) = sel.select(SELECT_TIMEOUT_MS)
INFO lldp#supervisord: lldpmgrd   File "/usr/lib/python2.7/dist-packages/swsscommon/swsscommon.py", line 965, in select
INFO lldp#supervisord: lldpmgrd     return _swsscommon.Select_select(self, timeout)
INFO lldp#supervisord: lldpmgrd   File "/usr/local/lib/python2.7/dist-packages/sonic_py_common/daemon_base.py", line 52, in signal_handler
INFO lldp#supervisord: lldpmgrd     log_info("DaemonBase: Caught SIGTERM - exiting...")
INFO lldp#supervisord: lldpmgrd NameError: global name 'log_info' is not defined

- How I did it
Fix the syntax error.
- How to verify it
Verified by static syntax analysis.
- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

No.

- A picture of a cute animal (not mandatory but encouraged)
No.

@jleveque
Copy link
Contributor

Thanks for the fix, @bingwang-ms!

@jleveque jleveque changed the title [sonic_py_common]Fix exception in daemon_base.py [sonic_py_common] Fix exception in daemon_base.py Sep 27, 2020
@jleveque jleveque merged commit e3f8159 into sonic-net:master Sep 27, 2020
abdosi pushed a commit that referenced this pull request Sep 28, 2020
There is a syntax error (self is missing for log_info and log_warning) in signal_handler in daemon_base.py, which causes an exception
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
There is a syntax error (self is missing for log_info and log_warning) in signal_handler in daemon_base.py, which causes an exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants