Refactored rsync_mirror.TRsync with functional tests
CLI tools updated according with API changes
PEP8 fixes
Closes-Bug: #1570260
Closes-Bug: #1575759
Change-Id: I26b3547854d670da2da94d469f88a3ea057f07db
diff --git a/trsync/cmd/cli.py b/trsync/cmd/cli.py
index eb7fa8f..41997c9 100644
--- a/trsync/cmd/cli.py
+++ b/trsync/cmd/cli.py
@@ -46,11 +46,11 @@
required=False,
help='Specified timestamp will be used for '
'snapshot. Format:yyyy-mm-dd-hhMMSS')
- parser.add_argument('--snapshot-dir',
+ parser.add_argument('--snapshots-dir', '--snapshot-dir',
required=False,
default='snapshots',
- help='Directory name for snapshots. "snapshots" '
- 'by default')
+ help='Directory name for snapshots relative '
+ '"destination". "snapshots" by default')
parser.add_argument('--init-directory-structure',
action='store_true',
required=False,
@@ -58,7 +58,7 @@
help='It specified, all directories including'
'"snapshots-dir" will be created on remote '
'location')
- parser.add_argument('--save-latest-days',
+ parser.add_argument('--snapshot-lifetime', '--save-latest-days',
required=False,
default=61,
help='Snapshots for specified number of days will '
@@ -97,9 +97,9 @@
if properties['extra'].startswith('\\'):
properties['extra'] = properties['extra'][1:]
properties['rsync_extra_params'] = properties.pop('extra')
- properties['save_latest_days'] = \
- None if properties['save_latest_days'] == 'None' \
- else int(properties['save_latest_days'])
+ properties['snapshot_lifetime'] = \
+ None if properties['snapshot_lifetime'] == 'None' \
+ else int(properties['snapshot_lifetime'])
failed = list()
for server in servers: