Renders list of parameters. Ensures that there's no cyclic or missing dependencies. Returns a dict of plain rendered parameters.
(
runner_parameters,
action_parameters,
params,
action_context,
additional_contexts=None,
)
| 303 | |
| 304 | |
| 305 | def render_live_params( |
| 306 | runner_parameters, |
| 307 | action_parameters, |
| 308 | params, |
| 309 | action_context, |
| 310 | additional_contexts=None, |
| 311 | ): |
| 312 | """ |
| 313 | Renders list of parameters. Ensures that there's no cyclic or missing dependencies. Returns a |
| 314 | dict of plain rendered parameters. |
| 315 | """ |
| 316 | additional_contexts = additional_contexts or {} |
| 317 | |
| 318 | pack = action_context.get("pack") |
| 319 | user = action_context.get("user") |
| 320 | |
| 321 | try: |
| 322 | config = get_config(pack, user) |
| 323 | except Exception as e: |
| 324 | LOG.info( |
| 325 | "Failed to retrieve config for pack %s and user %s: %s" |
| 326 | % (pack, user, six.text_type(e)) |
| 327 | ) |
| 328 | config = {} |
| 329 | |
| 330 | G = _create_graph(action_context, config) |
| 331 | |
| 332 | # Additional contexts are applied after all other contexts (see _create_graph), but before any |
| 333 | # of the dependencies have been resolved. |
| 334 | for name, value in six.iteritems(additional_contexts): |
| 335 | G.add_node(name, value=value) |
| 336 | |
| 337 | [_process(G, name, value) for name, value in six.iteritems(params)] |
| 338 | _process_defaults(G, [action_parameters, runner_parameters]) |
| 339 | _validate(G) |
| 340 | |
| 341 | context = _resolve_dependencies(G) |
| 342 | live_params = _cast_params_from( |
| 343 | params, context, [action_parameters, runner_parameters] |
| 344 | ) |
| 345 | |
| 346 | return live_params |
| 347 | |
| 348 | |
| 349 | def render_final_params(runner_parameters, action_parameters, params, action_context): |
no test coverage detected