Page MenuHomeDevCentral

Improve cmd.run usage
ClosedPublic

Authored by dereckson on Feb 28 2018, 15:20.
Tags
None
Referenced Files
F6844980: D1359.diff
Tue, Apr 15, 06:05
F6839294: D1359.id.diff
Tue, Apr 15, 00:24
F6833368: D1359.id3477.diff
Mon, Apr 14, 10:47
Unknown Object (File)
Sun, Apr 13, 05:12
Unknown Object (File)
Fri, Apr 11, 13:55
Unknown Object (File)
Fri, Apr 11, 03:01
Unknown Object (File)
Sun, Mar 30, 00:11
Unknown Object (File)
Thu, Mar 20, 21:11
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.