File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[project ]
22name = " koi-net"
3- version = " 2.0.2 "
3+ version = " 2.0.3 "
44description = " Implementation of KOI-net framework in Python"
55maintainers = [
66 { name = " Luke Miller" , email = " luke@block.science" }
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ def wipe(self):
121121 pass
122122
123123 try :
124- os .remove (self ._root_dir / self .private_key_pem_path )
124+ os .remove (self ._root_dir / self .koi_net . private_key_pem_path )
125125 except FileNotFoundError :
126126 pass
127127
Original file line number Diff line number Diff line change 1- from dataclasses import dataclass
21import socket
2+ from dataclasses import dataclass
33from logging import Logger
44
55from ..infra import depends_on
@@ -22,15 +22,16 @@ def acquire_port(self):
2222 base_url_is_derived = (self .config .koi_net .node_profile .base_url == self .config .server .url )
2323
2424 changed_port : bool = False
25- with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
26- address = (self .config .server .host , self .config .server .port )
27- while s .connect_ex (address ) == 0 :
28- self .log .debug (f"Port { address [1 ]} in use" )
25+ while True :
26+ with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
27+ if s .connect_ex ((self .config .server .host , self .config .server .port )) != 0 :
28+ break
29+
30+ self .log .debug (f"Port { self .config .server .port } in use" )
2931 self .config .server .port += 1
30- address = (address [0 ], self .config .server .port )
3132 changed_port = True
3233
33- self .log .debug (f"Acquired port { address [ 1 ] } " )
34+ self .log .debug (f"Acquired port { self . config . server . port } " )
3435
3536 if base_url_is_derived and changed_port :
3637 self .log .debug ("Updating node profile" )
You can’t perform that action at this time.
0 commit comments