Commit 9ca86b73 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor changes to elabinelab_attributes; change the separation

character from , to ; (yes, very important change, I know).
parent 058ebf1a
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -772,7 +772,7 @@ Simulator instproc run {} {
if {$elab_in_elab} {
foreach attr $elabinelab_attributes {
set fields [list "role" "attrkey" "attrvalue" "ordering"]
set values [split $attr ","]
set values [split $attr ";"]
$self spitxml_data "elabinelab_attributes" $fields $values
}
}
......
......@@ -136,7 +136,7 @@ namespace eval TBCOMPAT {
set elabinelab_attributes {}
variable EINEROLE {^(all|boss|ops|fs|router|node)$}
variable EINEKEY {^([-\w\.]+)$}
variable EINEVALUE {^([-\w\.\+\,\s\/]+)$}
variable EINEVALUE {^([-\w\.\+\,\s\/:]+)$}
variable EINEORDER {^\d+$}
# virt blobs stuff
......@@ -2046,11 +2046,11 @@ proc tb-set-elabinelab-role-attribute {role key value {order 0}} {
# If role/key/ordering exactly matches an existing value,
# replace it to preserve uniqueness, otherwise just add it.
#
set i [lsearch -glob $elabinelab_attributes "$r,$key,*,$order"]
set i [lsearch -glob $elabinelab_attributes "$r;$key;*;$order"]
if {$i > -1} {
set elabinelab_attributes [lreplace $elabinelab_attributes $i $i]
}
lappend elabinelab_attributes "$r,$key,$value,$order"
lappend elabinelab_attributes "$r;$key;$value;$order"
}
}
......@@ -2062,9 +2062,9 @@ proc tb-get-elabinelab-role-attribute {role key} {
var_import ::TBCOMPAT::elabinelab_attributes;
set ret {}
set i [lsearch -glob $elabinelab_attributes "$role,$key,*,0"]
set i [lsearch -glob $elabinelab_attributes "$role;$key;*;0"]
if {$i > -1} {
set values [split [lindex $elabinelab_attributes $i] ","]
set values [split [lindex $elabinelab_attributes $i] ";"]
set ret [lindex $values 2]
}
return $ret
......@@ -2090,8 +2090,8 @@ proc tb-unset-elabinelab-role-attribute {role key} {
}
foreach r $roles {
while {[lsearch -glob $elabinelab_attributes "$r,$key,*"] > -1} {
set i [lsearch -glob $elabinelab_attributes "$r,$key,*"]
while {[lsearch -glob $elabinelab_attributes "$r;$key;*"] > -1} {
set i [lsearch -glob $elabinelab_attributes "$r;$key;*"]
set elabinelab_attributes [lreplace $elabinelab_attributes $i $i]
}
}
......
Supports Markdown
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