![](/img/trans.png)
[英]OpenDaylight Yangtools codeGeneratorClass for CodeGenerator cannot be null
[英]Opendaylight yangtools XML encoding out of order for keyed list
當 yang model 有一個包含多個鍵的列表時,ODL 在將請求向下發送到 netconf 設備時不會保持屬性的順序。 從 RFC 6020 看來,需要嚴格遵守順序。
“列表的關鍵節點被編碼為列表標識符元素的子元素,其順序與它們在“關鍵”語句中定義的順序相同。”
主要是我的供應商設備在創建無序列表時沒有抱怨,但在刪除過程中抱怨錯誤。
楊model例子:
container acl-config {
list acl-config-list {
key "tenant-id access-control-list-id";
leaf tenant-id {
type leafref {
path "/tenant:tenant-config/tenant:tenant-list/tenant:tenant-id";
}
description
"Unique identifier of the Tenant";
}
leaf access-control-list-id {
type custom-id;
mandatory true;
description
"Unique ACL identifier";
}
}
刪除操作期間編碼時的ODL發送請求如下:
<edit-config>
<target>
<running/>
</target>
<default-operation>none</default-operation>
<error-option>rollback-on-error</error-option>
<config>
<acl-config xmlns="http://example.com/acl">
<acl-config-list>
<access-control-list-id>acl7</access-control-list-id>
<tenant-id>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</tenant-id>
<acl-dst-config xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0"
a:operation="delete"/>
</acl-config-list>
</acl-config>
</config>
</edit-config>
</rpc>
我希望先對租戶 ID 進行編碼,而不是按照 yang 中定義的密鑰順序對 access-control-list-id 進行編碼。 刪除操作期間設備拋出錯誤
<rpc-error>
<error-type>protocol</error-type>
<error-tag>missing-element</error-tag>
<error-severity>error</error-severity>
<error-message xml:lang="en">Invalid position of the key "tenant-id" in a
list "acl-config-list".</error-message>
<error-info>
<bad-element>/access_control_list:acl-config/acl-config-list[access-
control-list-id='acl7']/tenant-id</bad-element>
</error-info>
</rpc-error>
我希望 ODL 在 XML 編碼期間以及按照 RFC 6020 聲明遵循嚴格的關鍵節點順序。 這沒有發生,設備純粹基於無序問題拒絕請求。 這是 ODL yangtools XML 編碼問題中的錯誤,還是設備真的應該以任何順序處理請求?
看起來這個問題在這里得到了回答
准確地說,提出了 jira ticket 來跟蹤這個問題。 https://jira.opendaylight.org/browse/YANGTOOLS-1037
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.