Closed bb-Ricardo closed 1 year ago
Any reason this why this hasn't been merged? The other two PR got merged except this one.
Thank you
Must have missed it, sorry!
Finally getting around to looking at this properly, and I think it's all wrong and the old code works just fine
If you pass "1", the split turns it into ["1"], and the join turns it back into "1", so it does what it needs to do. Can you tell me what you're actually passing as argument, and how what the old code does is wrong? Maybe then I'll understand better what you're trying to achieve.
Hi, what I do: Get the data from ILO as json, manipulate one attribute and sending the whole json back.
This didn't work. With this change it fixed it.
What was the value you changed it to?
Just "6" as single privilege. And it's not an list so it cant iterate over it. Und just "6" should be valid.
It should be, and is valid. The old code will turn that "6" into ["6"] in the split, and then that ["6"] back into a "6" in the join. Can you run the old code in debug mode (setting the debug attribute of the ilo isntance, or passing --debug to hpilo_cli) and share the output. I have a sneaky suspicion it's not your "6" that's the problem, but something else returned by the iLO. I'd also like to see which error you're getting.
Will be able to do that next week. Can only test it at work.
I figured out what the actual issue is: the xml parser magic turns the privileges you get from the ilo into integers and not single-digit strings. So when you feed those back in, those are the ones that are not iterable (strings are iterable just fine). 728c085 fixes it.
Yes, this sounds like the issue I had. Was so long ago that I had trouble remembering what the actual problem was.
Thanks for fixing it.
Currently the privileges in mod_dir_config need to be comma separated to be accepted. This will not work for single privileges like "1" or "6".
This commit fixes this.