From 986bcb0e1c0d375d1456313da1190d39f97feb76 Mon Sep 17 00:00:00 2001 From: Stavros Sachtouris <saxtouri@admin.grnet.gr> Date: Wed, 1 Jul 2015 13:28:58 +0300 Subject: [PATCH] Adjust CLI to new status report mechanism --- agkyra/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agkyra/cli.py b/agkyra/cli.py index 3c7bf08..07cec6a 100644 --- a/agkyra/cli.py +++ b/agkyra/cli.py @@ -36,6 +36,8 @@ NOTIFICATION = { 1000: 'Critical error' } +remaining = lambda st: st['unsynced'] - (st['synced'] + st['failed']) + class ConfigCommands: """Commands for handling Agkyra config options""" @@ -234,7 +236,7 @@ class AgkyraCLI(cmd.Cmd): status, msg = client.get_status() if client else None, 'Not running' if status: msg = NOTIFICATION[status['code']] - diff = status['unsynced'] - status['synced'] + diff = remaining(status) if diff: msg = '%s, %s remaining' % (msg, diff) sys.stdout.write('%s\n' % msg) -- GitLab