Forum Discussion
Can't use variable for vlan selection during route domain creation?
I have to create several route demain and associate 2 vlans per route domain with tmsh script.
- I try it making a for loop for my total number of route domain to create.
- I select the right partition (successfully created previously)
- I create my route-domain and want to select a vlan previously created. My vlans are incremented and their name contain a number. I want to be able to use this incrementation to select my vlans for route-domain creation. BUT, it seems to be impossible to use variable in vlan name, I have the following message error :
pipo.tcl: script failed to complete:
can't eval proc: "script::run"
"vsys$x-vlan" unexpected argument
while executing
"tmsh::create net route-domain $numrd vlans add { vsys$x-vlan }"
(procedure "script::run" line 42)
invoked from within
"script::run" line:1
script did not successfully complete, status:1
- Here is an extract of my script :
set usercount 10
set numrd 12
for {set x 1} {$x<=$usercount} {incr x} {
tmsh::modify cli admin-partitions query-partitions all update-partition fce-vsys$x
tmsh::create net route-domain $numrd vlans add { vsys$x-vlan }
incr numrd
}
}
tmsh::modify cli admin-partitions query-partitions all update-partition Common
- I tried without {}, no success. Somebody have an Idea?
Thanks!
- hooleylistCirrostratusHi NQ,
- Mark_Crosland_2Historic F5 AccountAnother issue is that {}'s are special characters in both tmsh and Tcl, so they must be escaped in Tcl so that Tcl doesn't swallow them.
- Alscion_68122NimbostratusHi Mark & hoolio,
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com