[PTP] Skip checking clock instance for ptp-lock

When no ts2phc instance is configured on a node, collectd incorrectly
tries to check 'clock' type instances for a PTP lock state. The 'clock'
instance type does not contain ptp4l configuration info and should not
be part of this check. This was resulting in an incorrect 'ptp no-lock'
alarm being raised.

Updated the logic for calling check_ptp_regular() so that 'clock'
instances are excluded.

Test plan:
PASS: Configure system with clock instance and no ts2phc instance,
verify alarm is not raised.
PASS: Configure system with clock and ts2phc instances and verify that
normal behaviour is unaffected.

Closes-bug: 1998132

Signed-off-by: Cole Walker <cole.walker@windriver.com>
Change-Id: Id3941ed2079478e9c1241cf613d3fa3486e653c0
This commit is contained in:
Cole Walker
2022-11-28 15:44:21 -05:00
parent 571d0e4205
commit 4efcb548db

View File

@@ -1414,7 +1414,7 @@ def read_func():
ctrl.phase = RUN_PHASE__SAMPLING
ctrl.log_throttle_count = 0
if not obj.capabilities['primary_nic']:
if not obj.capabilities['primary_nic'] and ctrl.instance_type != PTP_INSTANCE_TYPE_CLOCK:
# Non-synce PTP
check_ptp_regular(instance, ctrl, conf_file)
elif (ptpinstances[instance].instance_type in