unitlab 2.3.38__tar.gz → 2.3.39__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitlab-2.3.38/src/unitlab.egg-info → unitlab-2.3.39}/PKG-INFO +1 -1
- {unitlab-2.3.38 → unitlab-2.3.39}/setup.py +1 -1
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/persistent_tunnel.py +8 -26
- {unitlab-2.3.38 → unitlab-2.3.39/src/unitlab.egg-info}/PKG-INFO +1 -1
- {unitlab-2.3.38 → unitlab-2.3.39}/LICENSE.md +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/README.md +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/setup.cfg +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/__init__.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/__main__.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/client.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/exceptions.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/main.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab/utils.py +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab.egg-info/SOURCES.txt +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab.egg-info/dependency_links.txt +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab.egg-info/entry_points.txt +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab.egg-info/requires.txt +0 -0
- {unitlab-2.3.38 → unitlab-2.3.39}/src/unitlab.egg-info/top_level.txt +0 -0
@@ -85,32 +85,14 @@ class PersistentTunnel:
|
|
85
85
|
}
|
86
86
|
|
87
87
|
def get_or_create_tunnel(self):
|
88
|
-
"""
|
89
|
-
#
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
#
|
96
|
-
response = requests.get(list_url, headers=headers)
|
97
|
-
if response.status_code == 200:
|
98
|
-
tunnels = response.json().get("result", [])
|
99
|
-
for tunnel in tunnels:
|
100
|
-
if tunnel["name"] == self.tunnel_name:
|
101
|
-
print("✅ Found existing tunnel: {}".format(tunnel["id"]))
|
102
|
-
self.tunnel_id = tunnel["id"]
|
103
|
-
|
104
|
-
# Tunnel exists, create a new one with unique name
|
105
|
-
print("⚠️ Tunnel with this name already exists")
|
106
|
-
import uuid
|
107
|
-
unique_suffix = str(uuid.uuid4())[:8]
|
108
|
-
self.tunnel_name = "agent-{}-{}".format(self.device_id, unique_suffix)
|
109
|
-
print("🔄 Creating new tunnel with unique name: {}".format(self.tunnel_name))
|
110
|
-
# Don't break, let it continue to create new tunnel
|
111
|
-
return self.create_new_tunnel()
|
112
|
-
|
113
|
-
# Create new tunnel
|
88
|
+
"""Always create a new tunnel with unique name to avoid conflicts"""
|
89
|
+
# Generate unique tunnel name to avoid conflicts
|
90
|
+
import uuid
|
91
|
+
unique_suffix = str(uuid.uuid4())[:8]
|
92
|
+
self.tunnel_name = "agent-{}-{}".format(self.device_id, unique_suffix)
|
93
|
+
print("🔧 Creating tunnel: {}...".format(self.tunnel_name))
|
94
|
+
|
95
|
+
# Always create new tunnel
|
114
96
|
return self.create_new_tunnel()
|
115
97
|
|
116
98
|
def create_new_tunnel(self):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|