Skip to content

Commit

Permalink
add l3 understack methods for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Fencik committed Dec 3, 2024
1 parent a520006 commit a262c46
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions python/neutron-understack/neutron_understack/l3_service_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from neutron.services.l3_router.l3_router_plugin import L3RouterPlugin


def print_context(message, context):
pprint(message)
pprint(context.to_dict())


class UnderStackL3ServicePlugin(L3RouterPlugin):
def __init__(self):
"""Understack L3 plugin.
Expand All @@ -18,7 +23,41 @@ def get_plugin_description(self):
return "Understack L3 Service Plugin"

def create_router(self, context, router):
pprint("create_router context:")
pprint(context.to_dict())
print_context("create_router", context)
pprint(router)

router_dict = super().create_router(context, router)
return router_dict

def update_router(self, context, id, router):
print_context("update_router", context)
pprint(router)
super().update_router(context, id, router)

def delete_router(self, context, id):
print_context("delete_router", context)
super().delete_router(context, id)

def add_router_interface(self, context, router_id, interface_info=None):
print_context("add_router_interface", context)
pprint(interface_info)
super().add_router_interface(context, router_id, interface_info)

def remove_router_interface(self, context, router_id, interface_info):
print_context("remove_router_interface", context)
pprint(interface_info)
super().remove_router_interface(context, router_id, interface_info)

def create_floatingip(self, context, floatingip):
print_context("create_floatingip", context)
pprint(floatingip)
super().create_floatingip(context, floatingip)

def update_floatingip(self, context, id, floatingip):
print_context("update_floatingip", context)
pprint(floatingip)
super().update_floatingip(context, id, floatingip)

def delete_floatingip(self, context, id):
print_context("delete_floatingip", context)
super().delete_floatingip(context, id)

0 comments on commit a262c46

Please sign in to comment.