diff --git a/proto/context.proto b/proto/context.proto index eb87dccf37177d9075f4137f0e6b41ee7dada25d..bb769a5a2cc37c7137be1da5f4e47edf41628f5e 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -154,8 +154,7 @@ message Topology { string name = 2; repeated DeviceId device_ids = 3; repeated LinkId link_ids = 4; - - repeated LinkId optical_link_ids=5; + repeated LinkId optical_link_ids = 5; } message TopologyDetails { @@ -163,8 +162,7 @@ message TopologyDetails { string name = 2; repeated Device devices = 3; repeated Link links = 4; - - repeated OpticalLink optical_links =5 ; + repeated OpticalLink optical_links = 5; } message TopologyIdList { diff --git a/src/automation/client/PolicyClient.py b/src/automation/client/PolicyClient.py index f2b25f2429d790c9cb25b5d70e1e737594586133..f7b6412a62670d0be2caa1460f7fab5ffec6fccd 100644 --- a/src/automation/client/PolicyClient.py +++ b/src/automation/client/PolicyClient.py @@ -19,7 +19,7 @@ from common.proto.policy_pb2 import PolicyRuleService, PolicyRuleState from common.proto.policy_pb2_grpc import PolicyServiceStub from common.tools.client.RetryDecorator import retry, delay_exponential from common.tools.grpc.Tools import grpc_message_to_json_string -from common.proto.openconfig_device_pb2_grpc import OpenConfigServiceStub + LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) @@ -40,7 +40,6 @@ class PolicyClient: def connect(self): self.channel = grpc.insecure_channel(self.endpoint) self.stub = PolicyServiceStub(self.channel) - self.openconfig_stub=OpenConfigServiceStub(self.channel) def close(self): if self.channel is not None: self.channel.close() diff --git a/src/common/type_checkers/Assertions.py b/src/common/type_checkers/Assertions.py index 3934c9d89568be90129bb766c61b55a532d2f0b3..01100eb680219eab5e2652f6e6d49e8b4615b033 100644 --- a/src/common/type_checkers/Assertions.py +++ b/src/common/type_checkers/Assertions.py @@ -451,7 +451,7 @@ def validate_slice(message): def validate_topology(message, num_devices=None, num_links=None): assert isinstance(message, dict) - assert len(message.keys()) == 4 + assert len(message.keys()) == 5 assert 'topology_id' in message validate_topology_id(message['topology_id']) assert 'name' in message @@ -464,6 +464,10 @@ def validate_topology(message, num_devices=None, num_links=None): assert isinstance(message['link_ids'], list) if num_links is not None: assert len(message['link_ids']) == num_links for link_id in message['link_ids']: validate_link_id(link_id) + assert 'optical_link_ids' in message + assert isinstance(message['optical_link_ids'], list) + if num_links is not None: assert len(message['optical_link_ids']) == num_links + for link_id in message['optical_link_ids']: validate_link_id(link_id) def validate_endpoint(message): assert isinstance(message, dict)