You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ycabled] fix no port/state returned by grpc server (sonic-net#308)
signed-off-by: vaibhav-dahiya [email protected]
This PR fixes and issue when gRPC listener acknowledges the request from ycabled but sends no ports/states in the response
Example for such responses :
Oct 19 21:38:32.643397 DEV NOTICE pmon#ycable[128076]: Set admin state RPC received response port Ethernet44 port ids = [] curr_read_side 0 read_side 1
Oct 19 21:38:32.643515 DEV NOTICE pmon#ycable[128076]: Set admin state RPC received response port Ethernet44 state values = [] curr_read_side 0 read_side 1
ycabled will write appropriate unknown/failure in such a case
# No other values expected, should we raise exception/msg
3314
+
# TODO handle other responses
3315
+
ifresponse.state[1] ==True:
3316
+
peer_state='active'
3317
+
elifresponse.state[1] ==False:
3318
+
peer_state='standby'
3319
+
3320
+
elifint(read_side) ==1:
3321
+
ifresponse.state[1] ==True:
3322
+
self_state='active'
3323
+
elifresponse.state[1] ==False:
3324
+
self_state='standby'
3325
+
ifresponse.state[0] ==True:
3326
+
peer_state='active'
3327
+
elifresponse.state[0] ==False:
3328
+
peer_state='standby'
3329
+
3330
+
else:
3331
+
helper_logger.log_warning("recieved an error port list while parsing response forwarding port state list size 0 {} {}".format(len(response.portid), len(response.state)))
0 commit comments