From 2d3715cc603573d2f0c84f5b053a7dbae0036c94 Mon Sep 17 00:00:00 2001 From: Vlad Gridin Date: Wed, 9 Jun 2021 17:19:54 +0200 Subject: [PATCH] Fix topology population when updating entries. Closes-Bug: PROD-11960 Change-Id: I82c111a0e219afe6e7a43981d48844d04ab3ae91 --- nuage_topology_collector/scripts/helper/osclient.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nuage_topology_collector/scripts/helper/osclient.py b/nuage_topology_collector/scripts/helper/osclient.py index 914eb61..dac3500 100644 --- a/nuage_topology_collector/scripts/helper/osclient.py +++ b/nuage_topology_collector/scripts/helper/osclient.py @@ -71,6 +71,7 @@ class NeutronClient(object): def __init__(self): self.client = None self.switchport_mapping_path = "/net-topology/switchport_mappings" + self.switchport_mappings_path = "/net-topology/switchport_mappings/%s" def authenticate(self): from neutronclient.neutron import client as neutron_client @@ -88,9 +89,14 @@ def authenticate(self): auth_url=keystone_client.credentials.auth_url)) return self - def get_switchport_mapping(self): + def get_switchport_mapping(self, retrieve_all=True, **_params): return self.client.list('switchport_mappings', - self.switchport_mapping_path) + self.switchport_mapping_path, + retrieve_all, + **_params) def create_switchport_mapping(self, body): return self.client.post(self.switchport_mapping_path, body) + + def update_switchport_mapping(self, id, body): + return self.client.put(self.switchport_mappings_path % id, body)