我会收到以下错误"否则"是保留的关键字。当用作" run关键字"
的标记时,它必须在大写(else)中代码狙击手如下...谁能帮助我解决该分辨率?谢谢
Run Keyword If '${intf_type}' == 'l3' Run Keywords
Execute Load Configuration @{target}[0] commit_comment=configure isis data=set interfaces xe-0/0/2:0 unit 0 family inet address 10.0.0.1/24 ${n} set interfaces xe-0/0/2:0 unit 0 family iso ${n} set protocols isis interface xe-0/0/2:0.0 ${n} set protocols isis interface lo0.0 format=set
Sleep 30s
ELSE IF '${intf_type}' == 'irb' Run Keywords
Execute Load Configuration @{target}[0] commit_comment=configure isis data=set interfaces xe-0/0/2:0 unit 0 family ethernet-switching interface-mode trunk ${n} set interfaces xe-0/0/2:0 unit 0 family ethernet-switching vlan members v-10 ${n} set interfaces irb unit 10 family inet address 10.0.0.1/24 ${n} set interfaces irb unit 10 family iso ${n} set protocols isis interface irb.10 ${n} set protocols isis interface lo0.0 ${n} set vlans v-10 vlan-id 10 ${n} set vlans v-10 l3-interface irb.10 format=set
很难读取您的代码段,因为它没有显示格式。否则如果需要正确的格式。重要的是要在同一块中和" ..."在线开始非常重要,这一点很重要。这里有两个例子,它们是否对您有帮助:
Set Variable
${x}= Set Variable 1
${var1}= Run Keyword If ${x} == 2 Set Variable 2
... ELSE IF ${x} == 1 Set Variable 1
Log ${var1}
Run Keyword
${x}= Set Variable 1
Run Keyword If ${x} == 2 Log 2
... ELSE IF ${x} == 1 Log 1