Commit c1ecb12c authored by Mike Hibler's avatar Mike Hibler

Begin to hack tcl code to support passing through elabinelab attributes

parent 43efbee5
......@@ -130,6 +130,14 @@ namespace eval TBCOMPAT {
variable elabinelab_source_tarfile ""
variable elabinelab_tarfiles
# Elabinelab attribute stuff.
variable elabinelab_attributes
array set elabinelab_attributes {}
variable EINEROLE {^(boss|ops|fs|router)$}
variable EINEKEY {^(\w[-\w\.]+)$}
variable EINEVALUE {^([-\w\s\.\,\/]+)$}
variable EINEORDER {^\d+$}
# Mapping of "resource classes" and "reservation types" to bootstrap
# values, where a resource class is a symbolic string provided by the user
# (e.g. Client, Server), and a reservation type is a resource name provided
......@@ -1719,7 +1727,7 @@ proc tb-set-dpdb {onoff} {
}
}
#
# Change the default topography.
# Change the default topology.
#
proc tb-elab-in-elab-topology {topo} {
var_import ::GLOBALS::elabinelab_topo
......@@ -1746,6 +1754,34 @@ proc tb-elabinelab-singlenet {args} {
set elabinelab_singlenet $onoff
}
#
# Set/clear elabinelab attributes:
# tb-set-elabinelab-attribute <role> <key> <value> [<order>]
# tb-unset-elabinelab-attribute <role> <key>
#
proc tb-set-elabinelab-attribute {role key value {order 0}} {
if {[regexp $EINEROLE $role] == 0} {
perror "\[tb-set-elabinelab-attribute] - $role is not a valid elabinelab role"
return
}
if {[regexp $EINEKEY $key] == 0} {
perror "\[tb-set-elabinelab-attribute] - \"$key\" is not a valid elabinelab key"
return
}
if {[regexp $EINEVALUE $value] == 0} {
perror "\[tb-set-elabinelab-attribute] - \"$value\" is not a valid elabinelab value"
return
}
if {[regexp $EINEORDER $order] == 0} {
perror "\[tb-set-elabinelab-attribute] - $order is not a valid elabinelab order"
return
}
}
proc tb-unset-elabinelab-attribute {role key} {
}
#
# Set the inner elab role for a node.
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment