Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mixed syntax #2095

Merged
merged 3 commits into from
Jan 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 14 additions & 22 deletions lib/cylc/cfgspec/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,33 +464,32 @@ 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'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders - this deprecate call is now redundant - the 'old' and 'new' args are the same (sorry, I missed this yesterday!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted! I've updated the back-port and have put up a new pull (#2103) for 7.0.x.

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(
'6.11.0',
['runtime', '__MANY__', 'retry delays'],
Expand All @@ -504,13 +503,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]


class RawSuiteConfig(config):
Expand Down
9 changes: 9 additions & 0 deletions lib/parsec/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions tests/deprecations/00-all.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ cmp_ok val.out <<__END__
* (6.4.0) [runtime][foo, cat, dog][dummy mode][command scripting] -> [runtime][foo, cat, dog][dummy mode][script] - value unchanged
* (6.5.0) [scheduling][special tasks][clock-triggered] -> [scheduling][special tasks][clock-trigger] - value unchanged
* (6.5.0) [scheduling][special tasks][external-triggered] -> [scheduling][special tasks][external-trigger] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][event hooks][retry handler] -> [runtime][foo, cat, dog][events][retry handler] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job submission][method] -> [runtime][foo, cat, dog][job][batch system] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job submission][command template] -> [runtime][foo, cat, dog][job][batch submit command template] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job submission][retry delays] -> [runtime][foo, cat, dog][job][submission retry delays] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][event hooks] -> [runtime][foo, cat, dog][events] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job submission] -> [runtime][foo, cat, dog][job] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job][method] -> [runtime][foo, cat, dog][job][batch system] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job][command template] -> [runtime][foo, cat, dog][job][batch submit command template] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][job][retry delays] -> [runtime][foo, cat, dog][job][submission retry delays] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][retry delays] -> [runtime][foo, cat, dog][job][execution retry delays] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][submission polling intervals] -> [runtime][foo, cat, dog][job][submission polling intervals] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][execution polling intervals] -> [runtime][foo, cat, dog][job][execution polling intervals] - value unchanged
Expand Down