Page MenuHomeDevCentral

Standardize states using pkg.installed everywhere
ClosedPublic

Authored by dereckson on Sep 13 2018, 09:58.
Tags
None
Referenced Files
F3766872: D1749.diff
Fri, Nov 22, 20:12
Unknown Object (File)
Sun, Nov 10, 07:49
Unknown Object (File)
Tue, Oct 29, 08:28
Unknown Object (File)
Fri, Oct 25, 09:05
Unknown Object (File)
Thu, Oct 24, 22:31
Unknown Object (File)
Oct 21 2024, 15:17
Unknown Object (File)
Oct 21 2024, 04:44
Unknown Object (File)
Oct 21 2024, 00:59
Subscribers
None

Details

Summary

Some entries contained only the state module name pkg
instead of the full function.

This approach was deemed more compatible with requisite logic,
where onyl the state module name and the id are required, without
the function name.

Yet, it's the only case this syntax was used, and as such, it should
be standardized.

If there is an advantage state module is more visible, there is also
a drawback: the function name isn't separated from the parameters.

As such, all states will now use the following syntax:

<id>:
   <state module>.<method>:
     - parameter1
     - parameter2
     - …
Test Plan

no op

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
dereckson added a reviewer: dereckson.

The following regexp was used to replace lines:

s/pkg:\n *\- installed/pkg.installed:/g

As sed replaces only one line at each time without a complicated script, perl was used to perform the replace:

perl -0777 -i -pe 's/pkg:\n *\- installed/pkg.installed:/g'

Mass replacement was so done by the following command:

find . -name '*sls' -exec perl -0777 -i -pe 's/pkg:\n *\- installed/pkg.installed:/g' {} \;

This revision is now accepted and ready to land.Sep 13 2018, 10:03
This revision was automatically updated to reflect the committed changes.