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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitlab
3
- Version: 2.3.38
3
+ Version: 2.3.39
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="unitlab",
5
- version="2.3.38",
5
+ version="2.3.39",
6
6
  license="MIT",
7
7
  author="Unitlab Inc.",
8
8
  author_email="team@unitlab.ai",
@@ -85,32 +85,14 @@ class PersistentTunnel:
85
85
  }
86
86
 
87
87
  def get_or_create_tunnel(self):
88
- """Get existing tunnel or create a new one"""
89
- # First, check if tunnel already exists
90
- print("🔍 Checking for existing tunnel: {}...".format(self.tunnel_name))
91
-
92
- list_url = "https://api.cloudflare.com/client/v4/accounts/{}/cfd_tunnel".format(self.cf_account_id)
93
- headers = self._get_headers()
94
-
95
- # Check if tunnel exists
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitlab
3
- Version: 2.3.38
3
+ Version: 2.3.39
4
4
  Home-page: https://github.com/teamunitlab/unitlab-sdk
5
5
  Author: Unitlab Inc.
6
6
  Author-email: team@unitlab.ai
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes