Implement Rsync summary extractor

This commit is contained in:
Bo Maryniuk 2015-07-08 18:51:44 +02:00
parent 57a8454253
commit eab59dd5d6

View File

@ -29,9 +29,19 @@ def __virtual__():
return salt.utils.which('rsync') and 'rsync' or False
def _get_summary(rsync_out):
def synchronized(name, source, delete=False, force=False, update=False,
passwordfile=None, exclude=None, excludefrom=None):
'''
Get summary from the rsync successfull output.
:param rsync_out:
:return:
'''
return "- " + "\n- ".join([elm for elm in rsync_out.split("\n\n")[-1].replace(" ", "\n").split("\n") if elm])
Synchronizing directories:
.. code-block:: yaml