From f79642d69ff1c15085ba4a08bbd8e8d2d7873b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 13 Feb 2018 16:50:37 +0100 Subject: [PATCH] Refuse to merge projects when SERVER_NAME is unset --- pillar/cli/operations.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pillar/cli/operations.py b/pillar/cli/operations.py index a8f457cf..67a4e632 100644 --- a/pillar/cli/operations.py +++ b/pillar/cli/operations.py @@ -130,6 +130,11 @@ def merge_project(src_proj_url, dest_proj_url): logging.getLogger('pillar').setLevel(logging.INFO) + log.info('Current server name is %s', current_app.config['SERVER_NAME']) + if not current_app.config['SERVER_NAME']: + log.fatal('SERVER_NAME configuration is missing, would result in malformed file links.') + return 5 + # Parse CLI args and get source and destination projects. projs_coll = current_app.db('projects') src_proj = projs_coll.find_one({'url': src_proj_url}, projection={'_id': 1}) @@ -149,7 +154,8 @@ def merge_project(src_proj_url, dest_proj_url): print() try: - input(f'Press ENTER to start moving ALL NODES AND FILES from {spid} to {dpid}') + input(f'Press ENTER to start moving ALL NODES AND FILES ' + f'from {src_proj_url} to {dest_proj_url}') except KeyboardInterrupt: print() print('Aborted')