PTP phc2sys fail to start when command line options have quotes

Bug #2045036 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
-----------------
The PTP's application phc2sys fails to start when its the cmdline_opts (command line options) is encapsulated in quotes.

For example, using the command line:
system ptp-instance-parameter-add phc-inst2 cmdline_opts="'-s ens1f0 -O -37'"

Also using DM configuration:
- cmdline_opts='-s ens1f0 -O -37'

Severity
--------
Minor

StarlingX bug reporting guidelines:
Please use the template below when opening StarlingX bugs.

Brief Description
-----------------
Provide a brief description of the issue. Usually, it should not be more than 2 to 3 lines.
Example: After performing a restore of the system, user is unable to swact the controller.

Severity
--------
Provide the severity of the defect.
<Critical: System/Feature is not usable due to the defect>
<Major: System/Feature is usable but degraded>
<Minor: System/Feature is usable with minor issue>

Steps to Reproduce
------------------
Write down the steps to reproduce the issue

Expected Behavior
------------------
The phc2sys application should start normally, the extra quotes should be ignored.

Actual Behavior
----------------
The phc2sys service fails to start.

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

System Configuration
--------------------
All

Branch/Pull Time/Commit
-----------------------
master

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

Timestamp/Logs
--------------
The hieradata cointains the cmdline_opts encapsulated between quotes:

$ sudo grep -B 10 phc2sys /etc/puppet/cache/hieradata/controller-0.yaml
platform::ptpinstance::config:
  phc-inst2:
    _name: phc-inst2
    cmdline_opts: '-s ens1f0 -O -37'
    device_parameters: {}
    global_parameters:
      message_tag: phc-inst2
    id: 1
    interfaces: []
    pmc_gm_settings: {}
    service: phc2sys

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

Workaround
----------
Correct the cmdline_opts removing the extra quotes from either the CLI or the DM configuration file.

For example:
system ptp-instance-parameter-add phc-inst2 cmdline_opts="-s ens1f0 -O -37"

DM example:
- cmdline_opts=-s ens1f0 -O -37

Changed in starlingx:
assignee: nobody → Andre Mauricio Zelak (azelak)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/902102

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

Reviewed: https://review.opendev.org/c/starlingx/config/+/902102
Committed: https://opendev.org/starlingx/config/commit/4ce5e25665dc74afc9bb84dcf3a8ae7d07144e83
Submitter: "Zuul (22348)"
Branch: master

commit 4ce5e25665dc74afc9bb84dcf3a8ae7d07144e83
Author: Andre Mauricio Zelak <email address hidden>
Date: Tue Nov 28 14:51:12 2023 -0300

    Improve PTP phc2sys cmdline_opts handling

    The cmdline_opts configuration field handling was improved to remove leading
    and trailing quotes characters. As the cmdline_opts is a freeform string
    field the enhancement can avoid errors starting the phc2sys service.

    Test plan:
    PASS - Encapsulate cmdline with '.
    PASS - Encapsulate cmdline with \'.

    Closes-Bug: 2045036

    Change-Id: I156673120c28f625a0200b46e74aeacd7f1b1955
    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.