[BUG] XML iterfind error #61181
Labels
Bug
broken, incorrect, or confusing behavior
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
XML state and module can not iterate across multiple values it only finds the first value only.
Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
Have an xml file (example log4j file) that contains multiple attributes with the same value. When trying to modify all the values it does not work
log4j example (only showing the logger information
As show about if i wanted to change all the logger levels to INFO i am having problems when doing in salt because it only returns the first log level (for com.exmaple) not all of them
when i change the xpath to include the @ salt throws an error
As per https://www.w3schools.com/xml/xml_xpath.asp you can use the xpath with an @ to grab all. Additionally, when i use an xml linter like xmlstarlet i can actually iterate through all the values
xmlstarlet view of all attributes
Expected behavior
The expected behavior would be to modify multiple attributes at once not just the first iteration it finds. Its looks like python findall might be the solution instead of iterfind. right now i am not able to take advantage of the salt module and stuck using cmd.run and running xmlstarlet locally to modify xml's
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: