Invalid PTP clock interface parameter causes puppet script error and exit

Bug #2043139 reported by Andre Mauricio Zelak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Andre Mauricio Zelak

Bug Description

Brief Description
-----------------

Configuring an invalid clock interface parameter causes the puppet script to error and exit before ending. Some configurations are not applied as consequence.

Severity
--------
Minor

Steps to Reproduce
------------------
system host-lock controller-0
system host-update controller-0 clock_synchronization=ptp
system ptp-instance-add myclock1 clock
system ptp-interface-add clockint1 myclock1
system host-if-ptp-assign controller-0 cass clockint1
system ptp-interface-parameter-add clockint1 sma1=output sync_rdka=enabled
system host-ptp-instance-assign controller-0 myclock1
system ptp-instance-apply
system host-unlock controller-0

Expected Behavior
------------------
The puppet script should warn about the invalid parameter and complete the clock configuration with the remaining valid parameters.

Actual Behavior
----------------
The puppet script errors out and exit, and the clock configuration is not applied to the clock-conf.conf file.

The current error message:
2023-11-09T16:13:42.403 ^[[1;31mError: 2023-11-09 16:13:42 +0000 Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /usr/share/puppet/modules/platform/manifests/ptpinstance.pp, line: 123, column: 16) (file: /usr/share/puppet/modules/platform/manifests/ptpinstance.pp, line: 206) on node controller-0

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
Any

Branch/Pull Time/Commit
-----------------------
Affects master branch as well as stx 8.0 & stx 7.0

Last Pass
---------
N/A

Timestamp/Logs
--------------
2023-11-09T16:13:42.403 ^[[1;31mError: 2023-11-09 16:13:42 +0000 Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /usr/share/puppet/modules/platform/manifests/ptpinstance.pp, line: 123, column: 16) (file: /usr/share/puppet/modules/platform/manifests/ptpinstance.pp, line: 206) on node controller-0

Test Activity
-------------
Feature Testing

Workaround
----------
Correct the invalid parameter in the configuration.

Changed in starlingx:
assignee: nobody → Andre Mauricio Zelak (azelak)
summary: - Invalid GNSS clock paramter causes puppet script error and exit
+ Invalid PTP clock parameter causes puppet script error and exit
summary: - Invalid PTP clock parameter causes puppet script error and exit
+ Invalid PTP clock interface parameter causes puppet script error and
+ exit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-puppet (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/stx-puppet/+/900556

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-puppet (master)

Reviewed: https://review.opendev.org/c/starlingx/stx-puppet/+/900556
Committed: https://opendev.org/starlingx/stx-puppet/commit/659a4d1ed91a39e8dcc5ebaa84a742b1299e32d6
Submitter: "Zuul (22348)"
Branch: master

commit 659a4d1ed91a39e8dcc5ebaa84a742b1299e32d6
Author: Andre Mauricio Zelak <email address hidden>
Date: Thu Nov 9 17:42:37 2023 -0300

    Validate PTP clock interface parameters

    Validate the given clock interface parameters and warn about
    the invalid ones.

    Test plan:
    PASS: Invalid interface parameter is ignored, and the conf file
    is written with remaining valid parameters.
    PASS: Change invalid to a valid parameter, the conf file is
    updated with valid parameters.

    Closes-Bug: 2043139

    Change-Id: I5ebf3655840eef6280b6544ad663d90c82bd275b
    Signed-off-by: Andre Mauricio Zelak <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0 stx.networking
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.