Skip to content

Commit

Permalink
Fix topology population when updating entries.
Browse files Browse the repository at this point in the history
Closes-Bug: PROD-11960
Change-Id: I82c111a0e219afe6e7a43981d48844d04ab3ae91
  • Loading branch information
Vlad Gridin committed Jun 9, 2021
1 parent ffe1107 commit 2d3715c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nuage_topology_collector/scripts/helper/osclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 2d3715c

Please sign in to comment.