我收到以下错误“Else If”是保留关键字。当用作带有“Run Keyword If”的标记时,它必须是大写的(ELSE IF)
代码片段如下...谁能帮我解决这个问题?谢谢
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
Run Code Online (Sandbox Code Playgroud)
小智 5
很难阅读您的代码片段,因为它没有显示格式。ELSE IF 需要正确的格式。在同一块中使用 ELSE IF 很重要,行首的“...”非常重要。这里有两个例子,它们对你有帮助吗:
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4039 次 |
| 最近记录: |