Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _check_old_yaml_format(self):
if self.flow_config.steps is None:
if "tasks" in self.flow_config.config:
raise FlowConfigError(
'Old flow syntax detected. Please change from "tasks" to "steps" in the flow definition.'
)
else:
raise FlowConfigError("No steps found in the flow definition")
def _get_steps_ordered(self):
if self.flow_config.steps is None:
if self.flow_config.tasks:
raise FlowConfigError(
'Old flow syntax detected. Please change from "tasks" to "steps" in the flow definition'
)
else:
raise FlowConfigError("No steps found in the flow definition")
if not self.nested:
self._check_infinite_flows(self.flow_config.steps)
steps = []
for step_num, config in list(self.flow_config.steps.items()):
if "flow" in config and "task" in config:
raise FlowConfigError(
'"flow" and "task" in same config item: {}'.format(config)
)
if ("flow" in config and config["flow"] == "None") or (
"task" in config and config["task"] == "None"
):
# allows skipping flows/tasks using YAML overrides
def _get_steps_ordered(self):
if self.flow_config.steps is None:
if self.flow_config.tasks:
raise FlowConfigError(
'Old flow syntax detected. Please change from "tasks" to "steps" in the flow definition'
)
else:
raise FlowConfigError("No steps found in the flow definition")
if not self.nested:
self._check_infinite_flows(self.flow_config.steps)
steps = []
for step_num, config in list(self.flow_config.steps.items()):
if "flow" in config and "task" in config:
raise FlowConfigError(
'"flow" and "task" in same config item: {}'.format(config)
)
if ("flow" in config and config["flow"] == "None") or (
"task" in config and config["task"] == "None"
):
# allows skipping flows/tasks using YAML overrides
continue
parsed_step_num = LooseVersion(str(step_num))
if "flow" in config: # nested flow
flow_config = self.project_config.get_flow(config["flow"])
steps.append(
(
parsed_step_num,
{"step_config": config, "flow_config": flow_config},
)
)
def _get_steps_ordered(self):
if self.flow_config.steps is None:
if self.flow_config.tasks:
raise FlowConfigError(
'Old flow syntax detected. Please change from "tasks" to "steps" in the flow definition'
)
else:
raise FlowConfigError("No steps found in the flow definition")
if not self.nested:
self._check_infinite_flows(self.flow_config.steps)
steps = []
for step_num, config in list(self.flow_config.steps.items()):
if "flow" in config and "task" in config:
raise FlowConfigError(
'"flow" and "task" in same config item: {}'.format(config)
)
if ("flow" in config and config["flow"] == "None") or (
"task" in config and config["task"] == "None"
):
# allows skipping flows/tasks using YAML overrides
continue
parsed_step_num = LooseVersion(str(step_num))
if "flow" in config: # nested flow
flow_config = self.project_config.get_flow(config["flow"])
steps.append(
(
parsed_step_num,
{"step_config": config, "flow_config": flow_config},
)
)
def _get_steps_ordered(self):
if self.flow_config.steps is None:
if self.flow_config.tasks:
raise FlowConfigError(
'Old flow syntax detected. Please change from "tasks" to "steps" in the flow definition'
)
else:
raise FlowConfigError("No steps found in the flow definition")
if not self.nested:
self._check_infinite_flows(self.flow_config.steps)
steps = []
for step_num, config in list(self.flow_config.steps.items()):
if "flow" in config and "task" in config:
raise FlowConfigError(
'"flow" and "task" in same config item: {}'.format(config)
)
if ("flow" in config and config["flow"] == "None") or (
"task" in config and config["task"] == "None"
):
# allows skipping flows/tasks using YAML overrides
continue
parsed_step_num = LooseVersion(str(step_num))
if "flow" in config: # nested flow
flow_config = self.project_config.get_flow(config["flow"])