Merge pull request #19561 from favadi/clean_file

add pkgrepo.managed clean_file option
This commit is contained in:
Thomas S Hatch 2015-01-09 17:51:35 -07:00
commit 8ec6d4a257

View File

@ -195,6 +195,10 @@ def managed(name, **kwargs):
file. The consolidate will run every time the state is processed. The
option only needs to be set on one repo managed by salt to take effect.
clean_file
If set to true, empty file before config repo, dangerous if use
multiple sources in one file.
refresh_db
If set to false this will skip refreshing the apt package database on
debian based systems.
@ -281,6 +285,10 @@ def managed(name, **kwargs):
ret['comment'] = ('Package repo {0!r} already configured'
.format(name))
return ret
if kwargs.get('clean_file', False):
open(kwargs['file'], 'w').close()
if __opts__['test']:
ret['comment'] = ('Package repo {0!r} will be configured. This may '
'cause pkg states to behave differently than stated '