Page MenuHomeDevCentral

Improve cmd.run usage
ClosedPublic

Authored by dereckson on Feb 28 2018, 15:20.
Tags
None
Referenced Files
F3769723: D1359.diff
Sat, Nov 23, 16:40
F3766575: D1359.id3478.diff
Fri, Nov 22, 19:03
Unknown Object (File)
Sat, Nov 16, 00:34
Unknown Object (File)
Sat, Nov 16, 00:13
Unknown Object (File)
Mon, Nov 11, 04:04
Unknown Object (File)
Sun, Nov 10, 15:26
Unknown Object (File)
Tue, Nov 5, 13:58
Unknown Object (File)
Tue, Nov 5, 11: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 Not Applicable
Unit
Tests Not Applicable

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.