Merge pull request #2693 from giantlock/develop

dry mode activated by different key in *BSD
This commit is contained in:
Thomas S Hatch 2012-11-25 19:34:09 -08:00
commit 6230ce32f8

View File

@ -612,7 +612,11 @@ def patch(originalfile, patchfile, options='', dry_run=False):
.. versionadded:: 0.10.4
'''
dry_run_opt = ' --dry-run' if dry_run else ''
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)