2021-09-27 12:08:32 +02:00
|
|
|
From 3beb3379dafe1adf9c1a43694f7b71938be3f583 Mon Sep 17 00:00:00 2001
|
2020-04-07 14:14:01 +02:00
|
|
|
From: Jochen Breuer <jbreuer@suse.de>
|
|
|
|
Date: Wed, 1 Apr 2020 16:13:23 +0200
|
|
|
|
Subject: [PATCH] Adds explicit type cast for port
|
|
|
|
|
|
|
|
If a port was passed as a string, the execution logic was broken
|
|
|
|
and a wrong set of remotes was returned.
|
|
|
|
|
|
|
|
The type casting to int solves this issue.
|
|
|
|
---
|
2021-09-27 12:08:32 +02:00
|
|
|
salt/utils/network.py | 4 ++++
|
|
|
|
1 file changed, 4 insertions(+)
|
2020-04-07 14:14:01 +02:00
|
|
|
|
|
|
|
diff --git a/salt/utils/network.py b/salt/utils/network.py
|
2021-09-27 12:08:32 +02:00
|
|
|
index 5fc9a34ca4..0dd20c5599 100644
|
2020-04-07 14:14:01 +02:00
|
|
|
--- a/salt/utils/network.py
|
|
|
|
+++ b/salt/utils/network.py
|
2021-09-27 12:08:32 +02:00
|
|
|
@@ -1703,6 +1703,10 @@ def _netlink_tool_remote_on(port, which_end):
|
|
|
|
chunks = line.split()
|
2021-01-08 13:41:50 +01:00
|
|
|
remote_host, remote_port = chunks[4].rsplit(":", 1)
|
2020-04-07 14:14:01 +02:00
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
+ if which_end == "remote_port" and int(remote_port) != int(port):
|
2021-09-27 12:08:32 +02:00
|
|
|
+ continue
|
2021-01-08 13:41:50 +01:00
|
|
|
+ if which_end == "local_port" and int(local_port) != int(port):
|
2021-09-27 12:08:32 +02:00
|
|
|
+ continue
|
2020-04-07 14:14:01 +02:00
|
|
|
remotes.add(remote_host.strip("[]"))
|
|
|
|
|
2021-09-27 12:08:32 +02:00
|
|
|
if valid is False:
|
2020-04-07 14:14:01 +02:00
|
|
|
--
|
2021-09-27 12:08:32 +02:00
|
|
|
2.33.0
|
2020-04-07 14:14:01 +02:00
|
|
|
|
|
|
|
|