[LON-CAPA-cvs] cvs: loncom / LondConnection.pm

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 04 Nov 2003 11:22:49 -0000


foxr		Tue Nov  4 06:22:49 2003 EDT

  Modified files:              
    /loncom	LondConnection.pm 
  Log:
  - Add SetDebugLevel to allow clients to control debugging output.
  - Fix ReadConfig, ReadForeignConfig - needed to set configuration read flag
    else new would re-read the default config and wipe out lonManage's
    attempts to read foreign config files e.g.
  
  
Index: loncom/LondConnection.pm
diff -u loncom/LondConnection.pm:1.16 loncom/LondConnection.pm:1.17
--- loncom/LondConnection.pm:1.16	Tue Nov  4 06:11:08 2003
+++ loncom/LondConnection.pm	Tue Nov  4 06:22:48 2003
@@ -1,7 +1,7 @@
 #   This module defines and implements a class that represents
 #   a connection to a lond daemon.
 #
-# $Id: LondConnection.pm,v 1.16 2003/11/04 11:11:08 foxr Exp $
+# $Id: LondConnection.pm,v 1.17 2003/11/04 11:22:48 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -70,6 +70,7 @@
 				"$perlvar{'lonTabDir'}/hosts.tab") || 
 				die "Can't read host table!!";
     %hostshash  = %{$hoststab};
+    $ConfigRead = 1;
     
 }
 
@@ -91,11 +92,18 @@
     my $MyHost   = shift;
     my $Filename = shift;
 
+    &Debug(4, "ReadForeignConfig $MyHost $Filename\n");
+
     $perlvar{lonHostID} = $MyHost; # Rmember my host.
     my $hosttab = read_hosts($Filename) ||
 	die "Can't read hosts table!!";
-    %hostshash = %{$hosttab}
-
+    %hostshash = %{$hosttab};
+    if($DebugLevel > 3) {
+	foreach my $host (keys %hostshash) {
+	    print "host $host => $hostshash{$host}\n";
+	}
+    }
+    $ConfigRead = 1;
 
 }