g.
MyNodesList:
- NodeName: test1
status: active
- NodeName: test2
status: active
- NodeName: test4
status: active
- NodeName: test5
status: active
and I have a list of keys which has keys as test1,test5 I want to match these keys in yaml and delete all other dict where it is not a match i.e. i want an output
MyNodesList:
- NodeName: test1
status: active
- NodeName: test5
status: active
Can someone please help me here ?
…………………………………………
New contributor
Rip Kirby is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.