Page MenuHomeDevCentral

Improve cmd.run usage
ClosedPublic

Authored by dereckson on Feb 28 2018, 15:20.
Tags
None
Referenced Files
F21134505: D1359.diff
Sat, Jan 17, 09:42
F21133085: D1359.id3478.diff
Sat, Jan 17, 05:44
F21132430: D1359.diff
Sat, Jan 17, 03:50
F21127883: D1359.diff
Fri, Jan 16, 16:50
F21127880: D1359.id3477.diff
Fri, Jan 16, 16:50
Unknown Object (File)
Fri, Jan 16, 02:43
Unknown Object (File)
Thu, Jan 15, 07:09
Unknown Object (File)
Sun, Jan 11, 16:30
Subscribers
None

Details

Summary

By nature, cmd.run is an imperative order more than a descriptive one.

This change ensures:

  • file.managed is used to set file modes/ownership
  • the descriptive creates is used instead of unless: test -f ...

Fixes T1349.

Test Plan
$ salt eglide state.apply roles/shellserver/odderon/config
[…]
Comment: File /opt/odderon/var/darkbot/userlist.db exists with proper permissions. No changes made.
[…]
$ salt eglide state.apply roles/webserver-core/letsencrypt/certificates test=True
[…]
Comment: /etc/letsencrypt/live/www.eglide.org/fullchain.pem exists
[…]

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
clean-cmd-run (branched from master)
Build Status
Buildable 2142
Build 2390: arc lint + arc unit

Event Timeline

dereckson created this revision.
This revision is now accepted and ready to land.Feb 28 2018, 15:21
This revision was automatically updated to reflect the committed changes.