Issues adding attribute to XML root node via augeas

前端 未结 1 1229
日久生厌
日久生厌 2021-01-15 05:44

I am using augeas to manipulate XML on some machines. Whereas creating new nodes and also setting a bunch of attributes worked like a charm I\'m biting my nails of adding a

相关标签:
1条回答
  • 2021-01-15 06:00

    Order matters in the Augeas tree. In that case, XML node attributes need to be set before the #text node and the child nodes.

    So what you need is:

    ins #attribute before /files/test.xml/Context/#text
    set /files/test.xml/Context/#attribute/allowLinking true
    

    Note that this change is not idempotent, since insert is not an idempotent operation.

    On Puppet, you could use onlyif to make this idempotent.

    0 讨论(0)
提交回复
热议问题