[LON-CAPA-cvs] cvs: doc /loncapafiles updatequery.piml
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 09 Dec 2002 21:27:36 -0000
albertel Mon Dec 9 16:27:36 2002 EDT
Modified files:
/doc/loncapafiles updatequery.piml
Log:
- Finished off BUG#1034
- tries harder to locate an existing domain description (looks in starter hosts.tab and installed hosts.tab)
- standalone mode works
Index: doc/loncapafiles/updatequery.piml
diff -u doc/loncapafiles/updatequery.piml:1.22 doc/loncapafiles/updatequery.piml:1.23
--- doc/loncapafiles/updatequery.piml:1.22 Mon Dec 9 16:10:44 2002
+++ doc/loncapafiles/updatequery.piml Mon Dec 9 16:27:36 2002
@@ -1,7 +1,7 @@
<!-- updatequery.piml -->
<!-- Scott Harrison -->
-<!-- $Id: updatequery.piml,v 1.22 2002/12/09 21:10:44 albertel Exp $ -->
+<!-- $Id: updatequery.piml,v 1.23 2002/12/09 21:27:36 albertel Exp $ -->
<!--
@@ -86,12 +86,7 @@
$lonCluster='production'; $flag=1;
}
elsif ($choice==2) {
- die("FIXME Broken!!!");
$lonCluster='standalone'; $flag=1;
- open(OUT,'>../'.$lonCluster.'_hosts.tab') or
- die('file generation error');
- print(OUT $line2insert);
- close(OUT);
}
elsif ($choice==3) {
$lonCluster='development'; $flag=1;
@@ -440,7 +435,7 @@
}
close(CONFIG);
}
- unless ($domainDescription) {
+ if (!$domainDescription && $lonCluster ne 'existing') {
open(IN,'<../'.$lonCluster.'_hosts.tab');
while(<IN>) {
if (/^$perlvar{'lonHostID'}\:/) {
@@ -449,8 +444,20 @@
last;
}
}
- close(IN);
+ close(IN);
}
+ if (!$domainDescription) {
+ open(IN,'</home/httpd/lonTabs/hosts.tab');
+ while(<IN>) {
+ if (/^$perlvar{'lonHostID'}\:/) {
+ (undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_);
+ chomp($domainDescription);
+ last;
+ }
+ }
+ close(IN);
+ }
+
# implement editing logic below, interactively
# update loncapa.conf until 8 is entered
@@ -603,6 +610,12 @@
$line2insert=<<END;
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription
END
+ if ($lonCluster eq 'standalone') {
+ open(OUT,'>../'.$lonCluster.'_hosts.tab') or
+ die('file generation error');
+ print(OUT $line2insert);
+ close(OUT);
+ }
if ($flag==1) {
`rm -f ../hosts.tab`;
open(IN,'<../'.$lonCluster.'_hosts.tab');