Add ability to specify rsync options
Added new flag '--rsync-options' to allow to use internal rsync options,
like '--link-dest' during mirror syncing on local machine to keep disk
space. Example:
parameters:
debmirror:
client:
mirrors:
mirror_name:
...
<current parameters>
...
rsync_options: [ '--link-dest=<path-to-dir>' ]
Change-Id: Id39275e66d08c056790fccc993597e17d208e812
Related-bug: PROD-22539
diff --git a/_states/debmirror.py b/_states/debmirror.py
index 47fe0d6..83c51a6 100644
--- a/_states/debmirror.py
+++ b/_states/debmirror.py
@@ -105,6 +105,11 @@
cmdline = " debmirror "
if tgt.get('extra_flags'):
cmdline += ' '.join(tgt['extra_flags'])
+ if tgt.get('rsync_options'):
+ rsync_options = tgt.get('rsync_options')
+ if tgt.get('rsync_options_defaults', True):
+ rsync_options = ['-aL', '--partial'] + rsync_options
+ cmdline += " --rsync-options='" + ' '.join(rsync_options) + "'"
if tgt.get('dist'):
cmdline += ' --dist=' + ",".join(tgt['dist'])
if tgt.get('section'):