community.general icon indicating copy to clipboard operation
community.general copied to clipboard

add special word '+value' to add_children/set_children in xml module

Open z1kk0 opened this issue 1 year ago • 6 comments

SUMMARY

This change adds support for creating value to node when using add_children/set_children with subnodes in xml module.

Closes #2372.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/modules/xml.py

z1kk0 avatar May 30 '24 01:05 z1kk0

cc @cmprescott @dagwieers @sm4rk0 @tbielawa click here for bot help

ansibullbot avatar May 30 '24 01:05 ansibullbot

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

plugins/modules/xml.py:308:25: W291: trailing whitespace

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

plugins/modules/xml.py:308:25: W291: trailing whitespace

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

plugins/modules/xml.py:308:25: W291: trailing whitespace

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

plugins/modules/xml.py:308:25: W291: trailing whitespace

click here for bot help

ansibullbot avatar May 30 '24 01:05 ansibullbot

Hi @russoz Thanks for you suggestion, I've committed your update. As for integration tests, I'll think about it, that's a good idea.

z1kk0 avatar Jun 02 '24 12:06 z1kk0

I made commit with +value and renamed PR

z1kk0 avatar Jun 02 '24 13:06 z1kk0

Sorry, what's wrong with this PR?

z1kk0 avatar Oct 06 '24 08:10 z1kk0

Sorry, I wanted to do some more tests/experiments, but never found time to actually do them yet...

felixfontein avatar Oct 07 '24 20:10 felixfontein

Hi @z1kk0 sorry for the radio silence, this one fell through the cracks.

Code-wise it looks good to me, but I still think it would be good to add a testcase to the integration tests.

russoz avatar Nov 02 '24 04:11 russoz

Any updates on this? I have the same use case @z1kk0 @russoz @felixfontein @ansibullbot

prateek45 avatar Mar 27 '25 23:03 prateek45

Hi @z1kk0 sorry for the long delay, this one got lost in the cracks , and I have had some busy weeks lately.

This PR requires a rebase, and we had mentioned before more tests. If you could add a test case under: https://github.com/ansible-collections/community.general/blob/main/tests/integration/targets/xml/tasks

That would be very helpful.

Instructions for rebasing: https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html

russoz avatar May 25 '25 09:05 russoz

Hi @russoz I did rebase and added one test case.

z1kk0 avatar May 29 '25 02:05 z1kk0

@z1kk0 thanks for your contribution! @russoz thanks for reviewing!

felixfontein avatar May 31 '25 14:05 felixfontein