@@ -447,50 +447,30 @@ def process_peer(self, *, peer: Peer):
447447 @param peer peer
448448 @raises ConfigurationException in case of error
449449 """
450- from_guid = ID (uid = peer .get_guid ())
451- from_type = ActorType .get_actor_type_from_string (actor_type = peer .get_type ())
452- to_guid = self .actor .get_guid ()
453- to_type = self .actor .get_type ()
454-
455- # We only like peers broker->site and orchestrator->broker
456- # Reverse the peer if it connects site->broker or broker->orchestrator
457-
458- if from_type == ActorType .Authority and to_type == ActorType .Broker :
459- from_guid , to_guid = to_guid , from_guid
460- from_type , to_type = to_type , from_type
461-
462- if from_type == ActorType .Broker and to_type == ActorType .Orchestrator :
463- from_guid , to_guid = to_guid , from_guid
464- from_type , to_type = to_type , from_type
465-
466- if from_type == ActorType .Authority and to_type == ActorType .Orchestrator :
467- from_guid , to_guid = to_guid , from_guid
468- from_type , to_type = to_type , from_type
450+ peer_guid = ID (uid = peer .get_guid ())
451+ peer_type = ActorType .get_actor_type_from_string (actor_type = peer .get_type ())
452+ actor_guid = self .actor .get_guid ()
453+ actor_type = self .actor .get_type ()
469454
470455 # peers between actors of same type aren't allowed unless the actors are both brokers
471- if from_type == to_type and from_type != ActorType .Broker :
456+ if peer_type == actor_type and peer_type != ActorType .Broker :
472457 raise ConfigurationException (
473458 "Invalid peer type: broker can only talk to broker, orchestrator or site authority" )
474459
475460 container = ManagementUtils .connect (caller = self .actor .get_identity ())
476- to_mgmt_actor = container .get_actor (guid = to_guid )
477- self .logger .debug (f"to_mgmt_actor= { to_mgmt_actor } to_guid= { to_guid } " )
478- if to_mgmt_actor is None and container .get_last_error () is not None :
461+ mgmt_actor = container .get_actor (guid = actor_guid )
462+ self .logger .info (f"Management Actor: { mgmt_actor } === { type ( mgmt_actor ) } " )
463+ if mgmt_actor is None and container .get_last_error () is not None :
479464 self .logger .error (container .get_last_error ())
480- from_mgmt_actor = container .get_actor (guid = from_guid )
481- self .logger .debug (f"from_mgmt_actor={ from_mgmt_actor } from_guid={ from_guid } " )
482- if from_mgmt_actor is None and container .get_last_error () is not None :
483- self .logger .error (container .get_last_error ())
484465
485466 self .vertex_to_registry_cache (peer = peer )
486467
487468 try :
488- client = RemoteActorCacheSingleton .get ().establish_peer (from_guid = from_guid ,
489- from_mgmt_actor = from_mgmt_actor ,
490- to_guid = to_guid , to_mgmt_actor = to_mgmt_actor )
469+ client = RemoteActorCacheSingleton .get ().establish_peer (mgmt_actor = mgmt_actor , peer_guid = peer_guid ,
470+ peer_type = peer_type )
491471 self .logger .debug (f"Client returned { client } " )
492472 if client is not None :
493- self .parse_exports (peer = peer , client = client , mgmt_actor = to_mgmt_actor )
473+ self .parse_exports (peer = peer , client = client , mgmt_actor = mgmt_actor )
494474 except Exception as e :
495475 raise ConfigurationException (f"Could not process exports from: { peer .get_guid ()} to "
496476 f"{ self .actor .get_guid ()} . e= { e } " )
0 commit comments