From 637a42b559109e603e72cb18cea4ecee730b6a5f Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Wed, 17 Mar 2021 11:46:57 +0000
Subject: [PATCH] Make update_mdc.py a bit more helpful

---
 webservice/update_mdc.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/webservice/update_mdc.py b/webservice/update_mdc.py
index 4a75efc34..38231ee4c 100644
--- a/webservice/update_mdc.py
+++ b/webservice/update_mdc.py
@@ -8,7 +8,7 @@ parser = argparse.ArgumentParser(
     description='Update run status at MDC for a given run id.')
 parser.add_argument('--conf-file', type=str, help='Path to webservice config',
                     default=osp.join(osp.dirname(__file__), 'webservice.yaml'))
-parser.add_argument('--flg', type=str, choices=["NA", "R", "A"],
+parser.add_argument('--flg', type=str, choices=["NA", "R", "A"], required=True,
                     help='Status flag for MDC request: NA - not available, R - running, A - available.')  # noqa
 parser.add_argument('--rid', type=int, help='Run id from MDC')
 parser.add_argument('--msg', type=str, help='Message string to MDC',
@@ -33,6 +33,7 @@ client_conn = MetadataClient(client_id=mdconf['user-id'],
                              scope=mdconf['scope'],
                              base_api_url=mdconf['base-api-url'])
 
+print(f"Updating run {rid} to status {flg} at {mdconf['base-api-url']}")
 response = client_conn.update_run_api(rid, {'flg_cal_data_status': flg,
                                             'cal_pipeline_reply': msg})
 
-- 
GitLab