From 3e9c27923714d9681aa38593b3af0149e229dff4 Mon Sep 17 00:00:00 2001
From: Neda Moeini <neda.moeini@GA0479-NMOEINI.local>
Date: Fri, 22 Sep 2023 14:47:13 +0200
Subject: [PATCH] Fixed get params bug in netbox client.

---
 gso/services/netbox_client.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gso/services/netbox_client.py b/gso/services/netbox_client.py
index 84d9c7e5..67cfe77e 100644
--- a/gso/services/netbox_client.py
+++ b/gso/services/netbox_client.py
@@ -9,7 +9,7 @@ import pydantic
 import pynetbox
 
 from gso.products import Router
-from gso.settings import NetBoxParams
+from gso.settings import NetBoxParams, load_oss_params
 from gso.utils.device_info import TierInfo, FEASIBLE_LAG_RANGE
 from gso.utils.exceptions import NotFoundError, WorkflowStateException
 
@@ -61,7 +61,8 @@ class Site(pydantic.BaseModel):
 
 class NetBoxClient:
     def __init__(self):
-        self.netbox = pynetbox.api(NetBoxParams.api, NetBoxParams.token)
+        netbox_params = load_oss_params().NETBOX
+        self.netbox = pynetbox.api(netbox_params.api, netbox_params.token)
 
     def get_all_devices(self):
         return list(self.netbox.dcim.devices.all())
-- 
GitLab