From 7f6d9673b48cf8e07f6f64fde1eb1a9cc868a01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Avil=C3=A9s?= Date: Mon, 19 Jan 2015 17:20:46 +0100 Subject: [PATCH] Livesync: Add --force to run command --- livesync/indico_livesync/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/livesync/indico_livesync/cli.py b/livesync/indico_livesync/cli.py index 3e99e39..086e06a 100644 --- a/livesync/indico_livesync/cli.py +++ b/livesync/indico_livesync/cli.py @@ -101,8 +101,9 @@ def initial_export(agent_id, force=False): db.session.commit() -@cli_manager.command -def run(agent_id=None): +@cli_manager.option('agent_id') +@cli_manager.option('--force', action='store_true') +def run(agent_id, force=False): """Runs the livesync agent""" update_session_options(db) if agent_id is None: @@ -118,7 +119,7 @@ def run(agent_id=None): if agent.backend is None: print cformat('Skipping agent: %{red!}{}%{reset} (backend not found)').format(agent.name) continue - if not agent.initial_data_exported: + if not agent.initial_data_exported and not force: print cformat('Skipping agent: %{red!}{}%{reset} (initial export not performed)').format(agent.name) continue print cformat('Running agent: %{white!}{}%{reset}').format(agent.name)