Don't fetch an implementation if an option is disabled.

This commit is contained in:
Ferdi Franceschini
2014-07-12 16:53:13 +10:00
parent d010e76076
commit 9305d6da53

View File

@ -1416,8 +1416,11 @@ def put_read_config(MyDriver):
txt += [' if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {'] txt += [' if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {']
txt += [' continue'] txt += [' continue']
txt += [' }'] txt += [' }']
txt += [' set name [dict get $v name]']
txt += [' set enabled [string tolower [dict get $v "enabled"]]'] txt += [' set enabled [string tolower [dict get $v "enabled"]]']
txt += [' if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {']
txt += [' continue']
txt += [' }']
txt += [' set name [dict get $v name]']
txt += [' set implementation [dict get $v "implementation"]'] txt += [' set implementation [dict get $v "implementation"]']
txt += [' if { !([dict exists $::config_dict $implementation]) } {'] txt += [' if { !([dict exists $::config_dict $implementation]) } {']
txt += [' continue'] txt += [' continue']
@ -1427,7 +1430,6 @@ def put_read_config(MyDriver):
txt += [' continue'] txt += [' continue']
txt += [' }'] txt += [' }']
txt += [' if { [string equal -nocase [dict get $v "driver"] "%s"] } {' % MyDriver['name']] txt += [' if { [string equal -nocase [dict get $v "driver"] "%s"] } {' % MyDriver['name']]
txt += [' if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {']
txt += [' if { ![string equal -nocase [SplitReply [%s]] "false"] } {' % MyDriver['simulation_group']] txt += [' if { ![string equal -nocase [SplitReply [%s]] "false"] } {' % MyDriver['simulation_group']]
txt += [' set asyncqueue "null"'] txt += [' set asyncqueue "null"']
txt += [' ${ns}::sics_log 9 "[%s] => using null asyncqueue"' % MyDriver['simulation_group']] txt += [' ${ns}::sics_log 9 "[%s] => using null asyncqueue"' % MyDriver['simulation_group']]
@ -1480,7 +1482,6 @@ def put_read_config(MyDriver):
txt += [' }'] txt += [' }']
txt += [' }'] txt += [' }']
txt += [' }'] txt += [' }']
txt += [' }']
txt += [' } catch_message ]'] txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}'] txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}'] txt += ['}']