@@ -125,7 +125,8 @@ def get_platform(
125
125
Returns:
126
126
platform: A platform definition dictionary. Uses either
127
127
get_platform() or platform_name_from_job_info(), but to the
128
- user these look the same.
128
+ user these look the same. This will be None if the platform
129
+ definition uses a subshell.
129
130
130
131
Raises:
131
132
NoPlatformsError:
@@ -142,7 +143,7 @@ def get_platform(
142
143
143
144
# NOTE: Do NOT use .get() on OrderedDictWithDefaults -
144
145
# https://github.com/cylc/cylc-flow/pull/4975
145
- elif 'platform' in task_conf and task_conf ['platform' ]:
146
+ if 'platform' in task_conf and task_conf ['platform' ]:
146
147
# Check whether task has conflicting Cylc7 items.
147
148
fail_if_platform_and_host_conflict (task_conf , task_name )
148
149
@@ -155,24 +156,22 @@ def get_platform(
155
156
# If platform name exists and doesn't clash with Cylc7 Config items.
156
157
return platform_from_name (task_conf ['platform' ], bad_hosts = bad_hosts )
157
158
158
- else :
159
- if get_platform_deprecated_settings (task_conf ) == []:
160
- # No deprecated items; platform is localhost
161
- return platform_from_name ()
162
- else :
163
- # Need to calculate platform
164
- # NOTE: Do NOT use .get() on OrderedDictWithDefaults - see above
165
- task_job_section = task_conf ['job' ] if 'job' in task_conf else {}
166
- task_remote_section = (
167
- task_conf ['remote' ] if 'remote' in task_conf else {})
168
- return platform_from_name (
169
- platform_name_from_job_info (
170
- glbl_cfg ().get (['platforms' ]),
171
- task_job_section ,
172
- task_remote_section
173
- ),
174
- bad_hosts = bad_hosts
175
- )
159
+ if get_platform_deprecated_settings (task_conf ) == []:
160
+ # No deprecated items; platform is localhost
161
+ return platform_from_name ()
162
+
163
+ # Need to calculate platform
164
+ # NOTE: Do NOT use .get() on OrderedDictWithDefaults - see above
165
+ task_job_section = task_conf ['job' ] if 'job' in task_conf else {}
166
+ task_remote_section = task_conf ['remote' ] if 'remote' in task_conf else {}
167
+ return platform_from_name (
168
+ platform_name_from_job_info (
169
+ glbl_cfg ().get (['platforms' ]),
170
+ task_job_section ,
171
+ task_remote_section ,
172
+ ),
173
+ bad_hosts = bad_hosts ,
174
+ )
176
175
177
176
178
177
def platform_from_name (
0 commit comments