diff --git a/tests/test_update_config.py b/tests/test_update_config.py index 7a4c79965051b5a31847ca9c02875fd08eaf1252..32588b2391b31317e69fdf162b11738ee93afdf0 100644 --- a/tests/test_update_config.py +++ b/tests/test_update_config.py @@ -70,6 +70,7 @@ def test_main(capsys): "--rel-gain", "true", "--webservice-address", "inproc://socket", "--correct", + "--verbose" ], ): with patch("zmq.Context", return_value=context): diff --git a/webservice/update_config.py b/webservice/update_config.py index 5143933c6839f9a1a0e7a97f626fae24a536d751..cef206fe51441ca397e525cab7c2b7a97e0d63fc 100755 --- a/webservice/update_config.py +++ b/webservice/update_config.py @@ -95,6 +95,9 @@ action_group.add_argument( action_group.add_argument( '--dark', '-d', action='store_true') +parser.add_argument( + '--verbose', '-v', action='store_true', + help='More verbose output, i.a. print the entire configuration written.') parser.add_argument( '--apply', action='store_true', help='Apply and push the requested configuration update to the git.') @@ -276,13 +279,15 @@ def main(): resp = socket.recv_multipart()[0] print("# Configuration now in place is:") - total_config = yaml.safe_load(resp.decode()) - - print(yaml.dump({ - action: {instrument: { - karabo_id: total_config[action][instrument][karabo_id] - }} - }, default_flow_style=False)) + if args['verbose']: + print(resp.decode()) + else: + total_config = yaml.safe_load(resp.decode()) + print(yaml.dump({ + action: {instrument: { + karabo_id: total_config[action][instrument][karabo_id] + }} + }, default_flow_style=False)) if __name__ == '__main__':