Skip to content

Commit

Permalink
Refactor - Inline function
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Keay committed Sep 10, 2024
1 parent ddef1ed commit 42279a6
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ def setup_conf():
setup_conf()


def argo_client():
return ArgoClient(
logger=LOG,
api_url=cfg.CONF.ml2_type_understack.argo_api_url,
namespace=cfg.CONF.ml2_type_understack.argo_namespace,
)

def dump_context(
context: NetworkContext | SubnetContext | PortContext,
) -> dict:
Expand Down Expand Up @@ -242,12 +235,18 @@ def update_port_precommit(self, context):
def update_port_postcommit(self, context):
log_call("update_port_postcommit", context)

argo_client = ArgoClient(
logger=LOG,
api_url=cfg.CONF.ml2_type_understack.argo_api_url,
namespace=cfg.CONF.ml2_type_understack.argo_namespace,
)

_move_to_network(
vif_type=context.current["binding:vif_type"],
mac_address=context.current["mac_address"],
device_uuid=context.current["binding:host_id"],
network_id=context.current["network_id"],
argo_client=argo_client(),
argo_client=argo_client,
)

def delete_port_precommit(self, context):
Expand Down

0 comments on commit 42279a6

Please sign in to comment.