From 83c7c52d049a5271ae01ac4e7d4cd20dd7fbe000 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 9 Jan 2017 08:58:40 +0000 Subject: [PATCH 1/3] Fixed mixed-syntax config upgrading. --- lib/cylc/cfgspec/suite.py | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/lib/cylc/cfgspec/suite.py b/lib/cylc/cfgspec/suite.py index 5ab7b17b5ad..b72de2bb6d2 100644 --- a/lib/cylc/cfgspec/suite.py +++ b/lib/cylc/cfgspec/suite.py @@ -555,31 +555,31 @@ def upg(cfg, descr): ['scheduling', 'special tasks', 'external-triggered'], ['scheduling', 'special tasks', 'external-trigger'], ) - for key in SPEC['cylc']['events']: - u.deprecate( - '6.11.0', ['cylc', 'event hooks', key], ['cylc', 'events', key]) - u.deprecate('6.11.0', ['cylc', 'event hooks']) - for key in SPEC['runtime']['__MANY__']['events']: - u.deprecate( - '6.11.0', - ['runtime', '__MANY__', 'event hooks', key], - ['runtime', '__MANY__', 'events', key]) - u.deprecate('6.11.0', ['runtime', '__MANY__', 'event hooks']) + u.deprecate( + '6.11.0', ['cylc', 'event hooks'], ['cylc', 'events']) + u.deprecate( + '6.11.0', + ['runtime', '__MANY__', 'event hooks'], + ['runtime', '__MANY__', 'events']) + u.deprecate( + '6.11.0', + ['runtime', '__MANY__', 'job submission'], + ['runtime', '__MANY__', 'job']) u.deprecate( '6.11.0', - ['runtime', '__MANY__', 'job submission', 'method'], + ['runtime', '__MANY__', 'job', 'method'], ['runtime', '__MANY__', 'job', 'batch system']) u.deprecate( '6.11.0', - ['runtime', '__MANY__', 'job submission', 'command template'], + ['runtime', '__MANY__', 'job', 'command template'], ['runtime', '__MANY__', 'job', 'batch submit command template']) u.deprecate( '6.11.0', - ['runtime', '__MANY__', 'job submission', 'shell'], + ['runtime', '__MANY__', 'job', 'shell'], ['runtime', '__MANY__', 'job', 'shell']) u.deprecate( '6.11.0', - ['runtime', '__MANY__', 'job submission', 'retry delays'], + ['runtime', '__MANY__', 'job', 'retry delays'], ['runtime', '__MANY__', 'job', 'submission retry delays']) u.deprecate('6.11.0', ['runtime', '__MANY__', 'job submission']) u.deprecate( @@ -595,13 +595,6 @@ def upg(cfg, descr): ['runtime', '__MANY__', 'execution polling intervals'], ['runtime', '__MANY__', 'job', 'execution polling intervals']) u.upgrade() - if 'cylc' in cfg and 'event hooks' in cfg['cylc']: - del cfg['cylc']['event hooks'] - if 'runtime' in cfg: - for section in cfg['runtime'].values(): - for key in ['event hooks', 'job submission']: - if key in section: - del section[key] # Force pre cylc-6 "cycling = Yearly" type suites to the explicit # dependency heading form for which backward compatibility is provided: From fa16a3bf940fc5f887a3439b881d76c56d329775 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 9 Jan 2017 08:59:35 +0000 Subject: [PATCH 2/3] Fixed upgrader bug where not specifying new keys. --- lib/parsec/upgrade.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/parsec/upgrade.py b/lib/parsec/upgrade.py index 9d4d89f6482..73c98cd187a 100755 --- a/lib/parsec/upgrade.py +++ b/lib/parsec/upgrade.py @@ -121,6 +121,15 @@ def expand(self, upg): else: i = -1 nkeys = upg['new'] + if nkeys is None: # No new keys defined. + for m in many: + exp_upgs.append({ + 'old': pre + [m] + post, + 'new': None, + 'cvt': upg['cvt'], + 'silent': upg['silent'], + }) + return exp_upgs npre = [] npost = [] for k in nkeys: From 9df2b89fb41b4825a82c5c12418885e9aae180c5 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 9 Jan 2017 10:11:12 +0000 Subject: [PATCH 3/3] Removed duplicate deprecation. --- lib/cylc/cfgspec/suite.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/cylc/cfgspec/suite.py b/lib/cylc/cfgspec/suite.py index b72de2bb6d2..204b20fe52a 100644 --- a/lib/cylc/cfgspec/suite.py +++ b/lib/cylc/cfgspec/suite.py @@ -573,10 +573,6 @@ def upg(cfg, descr): '6.11.0', ['runtime', '__MANY__', 'job', 'command template'], ['runtime', '__MANY__', 'job', 'batch submit command template']) - u.deprecate( - '6.11.0', - ['runtime', '__MANY__', 'job', 'shell'], - ['runtime', '__MANY__', 'job', 'shell']) u.deprecate( '6.11.0', ['runtime', '__MANY__', 'job', 'retry delays'],