-
Notifications
You must be signed in to change notification settings - Fork 52
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
Failed parsing YAML experiment: while parsing a flow sequence #146
Comments
Hello @antonionovaesjr Thanks for the report. I don't use YAML as an input that often so I'll have to look into it. Hard to say if the issue is with the parser or the yaml itself indeed. |
The issue here is with the syntax of the yaml. In most cases you can leave strings unquoted and yaml will just consider them as strings. however in some cases you need to use quotes so yaml doesn't interprete a specific char as a yaml token, which is the case here. Using your import yaml
with open("experiment2.yaml") as exp:
yaml.safe_load(exp) OUTPUT
Also you seem to be mixing the block style and flow style with your sequences and mappings. While these yield the same result in most cases, flow style is what's causing your issue here and how it is handled by the parser. There are two way to resolve this. Either quote your values in the flow sequence and mappings for example method:
- type: action
name: change-subnets-asg
provider:
arguments:
subnets: [ "${subnet01}" , "${subnet02}" ]
asg_names: ["${nodegroup_infra}","${ nodegroup_app}"]
func: change_subnets
module: chaosaws.asg.actions
type: python Or switch these to block style, this would be my prefered choice as its the more common style used and what the majority of your experiment already uses for its style method:
- type: action
name: change-subnets-asg
provider:
arguments:
subnets:
- ${subnet01}
- ${subnet02}
asg_names:
- ${nodegroup_infra}
- ${ nodegroup_app}
func: change_subnets
module: chaosaws.asg.actions
type: python using either method to correct the file i can successfully run
Where are before with your original file I got
|
Description:
When I use configuration values inside a list, such as tags or subnets_ids from the chasaws addon, json parse error occurs
python -V:
Python 3.11.7
chaos.exe info core:
NAME VERSION
CLI 1.18.0
Core library 1.41.0
chaos info extensions
NAME VERSION LICENSE DESCRIPTION
chaostoolkit-aws 0.31.1 Apache License Version 2.0 AWS
chaostoolkit-kubernetes 0.34.1 Apache License Version 2.0 Kubernetes
chaostoolkit-reporting 0.17.1 Apache License Version 2.0 Chaos engineering toolkit reporting library
Experiment 01:
Experiment 02:
Error msg:
The text was updated successfully, but these errors were encountered: