无法弄清楚如何正确添加仅在 augeas 中



我有以下xml:

<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener max-post-size="104857600" name="undertow-http" proxy-address-forwarding="${proxy.address.forwarding}" receive-buffer="524288" redirect-socket="https" send-buffer="524288" socket-binding="http"/>
<https-listener max-post-size="104857600" name="undertow-https" proxy-address-forwarding="${proxy.address.forwarding}" receive-buffer="524288" security-realm="ewb-ssl" send-buffer="524288" socket-binding="https" verify-client="NOT_REQUESTED"/>
<host alias="localhost" name="default-host"/>
</server>
<servlet-container name="default">
<jsp-config/>
<persistent-sessions/>
</servlet-container>
<handlers/>
</subsystem>

使用Augeas,我正在更改该XML中的一些值:

set subsystem[#attribute/xmlns='urn:jboss:domain:undertow:1.1']/server[#attribute/name='default-server']/http-listener[#attribute/name='undertow-http']/#attribute/proxy-address-forwarding 'true'",

但是在运行应用程序之后,XML 中的以下属性

xmlns='urn:jboss:domain:undertow:1.1

更改为:

xmlns='urn:jboss:domain:undertow:1.2

之后,Augeas 开始在 XML 文件中添加新字段:

<subsystem><server><http-listener proxy-address-forwarding="true"></http-listener>

我尝试仅添加条件以避免添加额外的字段,但没有成功,有人可以帮忙吗?谢谢

适用于:

onlyif  => "get #attribute/xmlns == 'urn:jboss:domain:undertow:1.1'",

相关内容

  • 没有找到相关文章

最新更新