Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unconfig] Adjust device discovery #51

Merged
merged 17 commits into from
Jun 14, 2024
Prev Previous commit
Next Next commit
Formatting (ruff)
Signed-off-by: Jakub Boguščiak <jakub.bogusciak@elisapolystar.com>
jbogusciak committed Jun 10, 2024
commit 4b12940ec17b0abfac3418f85255ab666b0d63c7
9 changes: 4 additions & 5 deletions uniconfig/python/frinx_worker/uniconfig/connection_manager.py
Original file line number Diff line number Diff line change
@@ -47,7 +47,6 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
if self.UniconfigApi.request is None:
raise Exception(f"Failed to create request {self.UniconfigApi.request}")


response = requests.request(
url=worker_input.uniconfig_url_base + self.UniconfigApi.uri,
method=self.UniconfigApi.method,
@@ -77,8 +76,6 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:

def _prepare_input(self, worker_input: WorkerInput) -> DictAny:
install_params: DictAny
username: str
password: str
if worker_input.connection_type == "cli":
jbogusciak marked this conversation as resolved.
Show resolved Hide resolved
install_params = self.Cli(**worker_input.install_params).model_dump()
install_params["cli-topology:username"] = worker_input.install_params.get("cli-topology:username")
@@ -91,8 +88,10 @@ def _prepare_input(self, worker_input: WorkerInput) -> DictAny:
}
elif worker_input.connection_type == "netconf":
install_params = self.Netconf(**worker_input.install_params).model_dump()
install_params["netconf-node-topology:username"] = worker_input.install_params.get("netconf-node-topology:username")
install_params["netconf-node-topology:username"] = worker_input.install_params.get("netconf-node-topology:username")
install_params["netconf-node-topology:username"] = (worker_input.install_params
.get("netconf-node-topology:username"))
install_params["netconf-node-topology:username"] = (worker_input.install_params
.get("netconf-node-topology:username"))
return {
"input": {
"node_id": worker_input.node_id,