From eab59dd5d633a05a76a0214bd203455afa59a78e Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Wed, 8 Jul 2015 18:51:44 +0200 Subject: [PATCH] Implement Rsync summary extractor --- salt/states/rsync.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/salt/states/rsync.py b/salt/states/rsync.py index fef922a87a..749e520528 100644 --- a/salt/states/rsync.py +++ b/salt/states/rsync.py @@ -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