cpu_quota: pre-define variables in run script

If a regexp does not match but the variable is used later, the script
exits with an error like

  can't read "slow_quota_sp": no such variable
This commit is contained in:
Christian Helmuth 2015-06-04 11:01:26 +02:00
parent 8ccac9a3bb
commit 4004a3a9ca
1 changed files with 4 additions and 0 deletions

View File

@ -170,6 +170,10 @@ proc check_quota { name opt_sp quota_sp opt quota } {
}
}
# pre-define variables if regexp does not match
set slow_quota ""; set midl_quota ""; set fast_quota ""
set slow_quota_sp ""; set midl_quota_sp ""; set fast_quota_sp ""
regexp {[0-9]+} [regexp -inline {slow. quota [0-9]+} $output] slow_quota
regexp {[0-9]+} [regexp -inline {midl. quota [0-9]+} $output] midl_quota
regexp {[0-9]+} [regexp -inline {fast. quota [0-9]+} $output] fast_quota