Skip to content
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

[lldpmgrd] Inherit DaemonBase class from sonic-py-common package #5370

Merged
merged 2 commits into from
Sep 15, 2020
Merged

[lldpmgrd] Inherit DaemonBase class from sonic-py-common package #5370

merged 2 commits into from
Sep 15, 2020

Conversation

jleveque
Copy link
Contributor

- Why I did it

Eliminate duplicate logging and signal handling code by inheriting from DaemonBase class in sonic-py-common package.

- How to verify it

Ensure lldpmgrd functionality is unchanged

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

@@ -198,6 +158,13 @@ class LldpManager(object):
Subscribe to CONFIG_DB - get notified of port config changes
Update LLDP configuration accordingly.
"""
self.log_info("Starting up...")

if not os.geteuid() == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be part of the base class?
We can initialize the base class with parameters?

Copy link
Contributor Author

@jleveque jleveque Sep 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good suggestion for a future improvement. For now I'd like to transition daemons to inherit from the base class as-is, then we can assess other remaining duplicated code (like this), and make improvements accordingly.

@jleveque jleveque marked this pull request as ready for review September 14, 2020 18:38
@jleveque
Copy link
Contributor Author

Retest vsimage please

@jleveque jleveque merged commit 12c94a7 into sonic-net:master Sep 15, 2020
@jleveque jleveque deleted the lldpmgrd_daemon_base branch September 15, 2020 17:55
abdosi pushed a commit that referenced this pull request Sep 19, 2020
Eliminate duplicate logging and signal handling code by inheriting from DaemonBase class in sonic-py-common package.
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…ic-net#5370)

Eliminate duplicate logging and signal handling code by inheriting from DaemonBase class in sonic-py-common package.
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