@@ -86,17 +86,17 @@ def detect_zipkin_server(microservices: dict, information_flows: dict, iterative
8686 microservices [correct_id ]["tagged_values" ] = [("Tracing Server" , "Zipkin" )]
8787
8888 if not zipkin_server_exists and connections_exist :
89- port = connections_exist . split ( "http:" )[ 1 ]. split ( ":" )[ 1 ]. strip ( "/" ). strip ()
90- try :
91- id = max ( microservices . keys ()) + 1
92- except :
93- id = 0
94- microservices [id ] = dict ()
95- microservices [id ]["name" ] = "zipkin-server"
96- microservices [id ]["image" ] = "placeholder_image"
97- microservices [id ]["properties" ] = [("port" , port , ("file" , "line" , "span" ))]
98- microservices [id ]["stereotype_instances" ] = ["tracing_server" ]
99- microservices [id ]["tagged_values" ] = [("Tracing Server" , "Zipkin" )]
89+ if "http:" in connections_exist :
90+ port = connections_exist . split ( "http:" )[ 1 ]
91+ if ":" in port :
92+ port = port . split ( ":" )[ 1 ]. strip ( "/" ). strip ()
93+ id_ = max ( microservices . keys (), default = - 1 ) + 1
94+ microservices [id_ ] = dict ()
95+ microservices [id_ ]["name" ] = "zipkin-server"
96+ microservices [id_ ]["image" ] = "placeholder_image"
97+ microservices [id_ ]["properties" ] = [("port" , port , ("file" , "line" , "span" ))]
98+ microservices [id_ ]["stereotype_instances" ] = ["tracing_server" ]
99+ microservices [id_ ]["tagged_values" ] = [("Tracing Server" , "Zipkin" )]
100100
101101
102102 if not iterative :
0 commit comments