Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mage into test2
  • Loading branch information
FengPan-Frank committed Nov 27, 2024
2 parents a97af95 + 1ed7dbb commit 91e7445
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def cfg_handler(self, data):

def stop_bmp(self):
self.log_info('BMPCfg: stop bmp daemon')
subprocess.call(["supervisorctl", "stop", "openbmpd"])
subprocess.call(["supervisorctl", "stop", "sonic-bmp:openbmpd"])


def reset_bmp_table(self):
Expand All @@ -66,7 +66,7 @@ def reset_bmp_table(self):

def start_bmp(self):
self.log_info('BMPCfg: start bmp daemon')
subprocess.call(["supervisorctl", "start", "openbmpd"])
subprocess.call(["supervisorctl", "start", "sonic-bmp:openbmpd"])


class BMPCfgDaemon:
Expand All @@ -85,6 +85,7 @@ def register_callbacks(self):
self.config_db.subscribe(BMP_TABLE,
lambda table, key, data:
self.bmp_handler(key, op, data))
self.config_db.listen(init_data_handler=self.bmpcfg.load)

def main():
daemon = BMPCfgDaemon()
Expand Down
7 changes: 5 additions & 2 deletions src/sonic-bmpcfgd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
url = 'https://github.com/Azure/sonic-buildimage',
maintainer = 'Feng Pan',
maintainer_email = 'fenpan@microsoft.com',
packages = setuptools.find_packages(),
packages=[
'bmpcfgd',
'tests'
],
install_requires = [
'jinja2>=2.10',
'netaddr==0.8.0',
Expand All @@ -24,7 +27,7 @@
],
entry_points={
'console_scripts': [
'bmpcfgd = scripts.bmpcfgd:main',
'bmpcfgd = bmpcfgd.bmpcfgd:main',
]
},
setup_requires = [
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-bmpcfgd/tests/bmpcfgd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

test_path = os.path.dirname(os.path.abspath(__file__))
modules_path = os.path.dirname(test_path)
scripts_path = os.path.join(modules_path, "scripts")
scripts_path = os.path.join(modules_path, "bmpcfgd")
sys.path.insert(0, modules_path)

# Load the file under test
bmpcfgd_path = os.path.join(scripts_path, 'bmpcfgd')
bmpcfgd_path = os.path.join(scripts_path, 'bmpcfgd.py')
bmpcfgd = load_module_from_source('bmpcfgd', bmpcfgd_path)


Expand Down

0 comments on commit 91e7445

Please sign in to comment.