Forum Discussion
iApp reconfiguration problem
I am having an issue with a TCL based iApp choice box upon reentry.
Background - The TCL script pulls a list of virtual servers that have a description field containing certain text. The select value is then used in a proc on the implementation side to make an entry into a data group for hostname to pool mapping. An iRule on the virtual server then does hostname based pool selection by doing a data group lookup. Multiple iApps can be mapped to the same data group to allow a single virtual server to host many applications.
Problem - The initial setup works great and makes the data group entry. The issue comes when we need to reconfigure the iapp. When you go back in the choice does not default to what you selected in the original configuration but rather defaults to the first item in the list.
Presentation code-
choice virtual_vs display "xlarge" tcl {
set virtuals [tmsh::get_config ltm virtual description]
foreach virtual $virtuals {
set name [tmsh::get_name $virtual]
set field_value [tmsh::get_field_value $virtual description]
if { [string match *iapp_name_host* $field_value] } {
append virtual_list "$name\r\n"
}
}
return $virtual_list
}
Implementation code -
proc add_pool_dg_value {vs fqdn pool_name dg_app_name} {
return "ltm data-group internal \/Common\/pool_select_$vs records add \{ [string tolower $fqdn] \{ data \"$pool_name|iApp - '$dg_app_name'\" \}\}"
}
2 Replies
- Eric_Flores_131
Cirrostratus
After hours of trying things I found the issue was the carriage return in the append command. Instead of -
append virtual_list "$name\r\n"
It should be -
append virtual_list "$name\n"
- hoolio
Cirrostratus
Thanks for posting the fix. Nice to see it was something simple (though possibly frustrating :))
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
