Commit 3a5bf377 authored by Mike Hibler's avatar Mike Hibler
Browse files

elabinelab fixes.

Important: re-map emulab-ops pid/gid indicies in the os_info and images table.

Nit: fix a comment typo ("all I did was change a comment, really!")
parent 118ff8dd
......@@ -91,9 +91,28 @@ else {
die("Tainted argument $pid!\n");
}
# Temporary ... See utils/firstuser ...
DBQueryFatal("update group_membership set pid_idx=1,gid_idx=1 ".
"where pid='$TBOPSPID' and pid=gid");
#
# XXX Fixup the pid/gid indicies for emulab-ops in various tables.
# At this point they have the values of the outer Emulab so they need
# to be reset to reflect the newly minted version here.
#
my @PIDGIDTABLES = ("group_membership", "images");
my @PIDONLYTABLES = ("os_info");
my $q = DBQueryFatal("select pid_idx from projects ".
"where pid='$TBOPSPID'");
my ($npid) = $q->fetchrow_array();
my $q = DBQueryFatal("select gid_idx from groups ".
"where pid='$TBOPSPID' and gid=pid");
my ($ngid) = $q->fetchrow_array();
foreach my $table (@PIDGIDTABLES) {
DBQueryFatal("update $table set pid_idx=$npid,gid_idx=$ngid ".
"where pid='$TBOPSPID' and pid=gid");
}
foreach my $table (@PIDONLYTABLES) {
DBQueryFatal("update $table set pid_idx=$npid where pid='$TBOPSPID'");
}
# Do not want to share the UUIDs with outer Emulab.
DBQueryFatal("update users set uid_uuid=UUID()");
......
......@@ -855,7 +855,7 @@ sub DumpDBGoo()
" Could not dump table group_membership\n");
#
# Initial images; not that these images are not going to exist inside!
# Initial images; note that these images are not going to exist inside!
#
DBQueryWarn("select * from images ".
"where pid='$pid' or (pid='$TBOPSPID' and global=1) ".
......
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