Page MenuHomeDevCentral

Improve cmd.run usage
ClosedPublic

Authored by dereckson on Feb 28 2018, 15:20.
Tags
None
Referenced Files
F10733920: D1359.id3478.diff
Fri, Jul 25, 10:44
F10732365: D1359.id3477.diff
Fri, Jul 25, 09:38
Unknown Object (File)
Wed, Jul 23, 10:36
Unknown Object (File)
Wed, Jul 23, 10:22
Unknown Object (File)
Mon, Jul 21, 18:51
Unknown Object (File)
Mon, Jul 21, 05:36
Unknown Object (File)
Fri, Jul 18, 06:54
Unknown Object (File)
Wed, Jul 9, 21:14
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.