Files
sics/site_ansto/instrument/util/check/check_sobj.tcl
Ferdi Franceschini 0749b0effa Merging release 2.0 branch with CVS trunk
r2601 | ffr | 2008-05-30 10:26:57 +1000 (Fri, 30 May 2008) | 2 lines
2012-11-15 13:38:17 +11:00

39 lines
1003 B
Tcl

fileeval util/check/query_sics.tcl
proc checksobj {} {
global sobj_sicstype_list
foreach sicstype $sobj_sicstype_list {
global ${sicstype}_attlist
clientput "Check $sicstype"
foreach sobj [tolower_sicslist type $sicstype] {
array unset sobj_attarray
array set sobj_attarray [attlist $sobj]
# Skip it if privilege is missing or set to "internal"
if {[info exists sobj_attarray(privilege)]} {
if {$sobj_attarray(privilege) == "internal"} {
continue
}
} else {
continue
}
foreach {att v} [set ${sicstype}_attlist] {
foreach a $att {
set attlist "$a @missing"
if {[query_attval $sobj $attlist]} {
clientput "$sobj: $a is missing"
continue
}
set attlist "$a \{$v\}"
if {![query_attval $sobj $attlist]} {
clientput "$sobj: $a should be one of ($v) not [getatt $sobj $a]"
}
}
}
}
}
}
publish checksobj user