mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #2693 from giantlock/develop
dry mode activated by different key in *BSD
This commit is contained in:
commit
6230ce32f8
@ -612,8 +612,12 @@ def patch(originalfile, patchfile, options='', dry_run=False):
|
||||
|
||||
.. versionadded:: 0.10.4
|
||||
'''
|
||||
dry_run_opt = ' --dry-run' if dry_run else ''
|
||||
cmd = 'patch {0}{1} {2} {3}'.format(
|
||||
if dry_run:
|
||||
if __grains__['kernel'] in ('FreeBSD', 'OpenBSD'):
|
||||
dry_run_opt = '-C'
|
||||
else:
|
||||
dry_run_opt = '--dry-run'
|
||||
cmd = 'patch {0} {1} {2} {3}'.format(
|
||||
options, dry_run_opt, originalfile, patchfile)
|
||||
return __salt__['cmd.run_all'](cmd)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user