1818from splitgraph .cloud .models import AddExternalRepositoryRequest , IntrospectionMode
1919from splitgraph .cloud .project .models import Metadata , SplitgraphYAML
2020from splitgraph .cloud .tunnel_client import (
21- get_rathole_client_binary_path ,
2221 launch_rathole_client ,
2322 write_rathole_client_config ,
2423)
@@ -1248,8 +1247,7 @@ def start_repository_tunnel(
12481247 tunnel_connect_host ,
12491248 )
12501249
1251- print ("launching rathole client" )
1252- launch_rathole_client (get_rathole_client_binary_path (), rathole_client_config_path )
1250+ launch_rathole_client (rathole_client_config_path )
12531251
12541252
12551253def start_ephemeral_tunnel (remote : str , local_address : str ) -> None :
@@ -1272,11 +1270,10 @@ def start_ephemeral_tunnel(remote: str, local_address: str) -> None:
12721270 local_address ,
12731271 tunnel_connect_host ,
12741272 )
1275- print (
1273+ click . echo (
12761274 f"To connect to { local_address } from Splitgraph, use the following connection parameters:\n Host: { private_address_host } \n Port: { private_address_port } "
12771275 )
1278- print ("launching rathole client" )
1279- launch_rathole_client (get_rathole_client_binary_path (), rathole_client_config_path )
1276+ launch_rathole_client (rathole_client_config_path )
12801277
12811278
12821279@click .command ("tunnel" )
@@ -1293,17 +1290,17 @@ def tunnel_c(remote: str, repositories_file: List[Path], repository_or_local_add
12931290 external repository specified in the argument.
12941291 """
12951292
1296- if repository_or_local_address . find ( "/" ) > - 1 :
1293+ if "/" in repository_or_local_address :
12971294 repository : "CoreRepository" = RepositoryType (exists = False ).convert (
12981295 repository_or_local_address , None , None
12991296 )
13001297 external = _get_external_from_yaml (repositories_file , repository )[0 ]
13011298 start_repository_tunnel (remote , repository , external )
13021299
1303- elif repository_or_local_address . find ( ":" ) > - 1 :
1300+ elif ":" in repository_or_local_address :
13041301 start_ephemeral_tunnel (remote , repository_or_local_address )
13051302 else :
1306- raise click .UsageError ("argument should be of the form namespace/repository or host:port" )
1303+ raise click .UsageError ("Argument should be of the form namespace/repository or host:port" )
13071304
13081305
13091306@click .group ("cloud" )
0 commit comments