Comments (1)
This same question was asked in chaostoolkit-aws (issue 146). I have added a comment that explains this behaviour and what the user needs to do to remediate it but I am also posting it here for completeness
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 experiment2.yaml
we can replicate this issue outside of chaostoolkit
import yaml
with open("experiment2.yaml") as exp:
yaml.safe_load(exp)
OUTPUT
line 483, in parse_flow_sequence_entry
raise ParserError("while parsing a flow sequence", self.marks[-1],
yaml.parser.ParserError: while parsing a flow sequence
in "experiment2.yaml", line 35, column 16
expected ',' or ']', but got '{'
in "experiment2.yaml", line 35, column 19
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
chaos validate .\experiment2.yaml
[2024-03-02 09:14:19 INFO] Validating the experiment's syntax
[2024-03-02 09:14:19 INFO] Experiment looks valid
[2024-03-02 09:14:19 INFO] experiment syntax and semantic look valid
Where are before with your original file I got
chaos validate .\experiment2.yaml
[2024-03-02 09:16:32 ERROR] Failed parsing YAML experiment: while parsing a flow sequence
in ".\experiment2.yaml", line 35, column 16
expected ',' or ']', but got '{'
in ".\experiment2.yaml", line 35, column 19
from chaostoolkit.
Related Issues (20)
- Make it easy to add items to an experiment HOT 2
- Using Kubernetes context 'default' from config '/home/interns_chaos/.kube/config' HOT 4
- Can not user non-default serviceAccountName HOT 1
- Not able to see -var-file options HOT 2
- Consider rewriting the core in Rust HOT 2
- Allow pass any variable via CLI as arguments HOT 2
- Variables from a .vars file HOT 2
- chaostoolkit azure plugin network latency for vmss how it is introducing latency into the network HOT 1
- Container image contains vulnerabilities HOT 1
- Switch to another log library as logzero is now archived HOT 2
- importlib metadata failure with Python 3.7 and 3.8 HOT 3
- chaostoolkit-reporting error HOT 2
- The link to the documentation in the documenation is incorrect
- TypeError: unsupported format string passed to NoneType.__format__ in the docker image HOT 1
- Can't run chaos HOT 4
- Python 3.12 can not install chaostoolkit-reporting successfully. HOT 7
- Chaos report feature dos not work HOT 1
- settings command fails ungracefully when file does not exist
- Broken katacoda.com link in the documentation HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chaostoolkit.