[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 17 Jul 2002 18:01:34 -0000


albertel		Wed Jul 17 14:01:34 2002 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - hndles borken lines better in hosts.tab, also allows blank lines (BUG#508)
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.251 loncom/lonnet/perl/lonnet.pm:1.252
--- loncom/lonnet/perl/lonnet.pm:1.251	Thu Jul  4 11:56:17 2002
+++ loncom/lonnet/perl/lonnet.pm	Wed Jul 17 14:01:33 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.251 2002/07/04 15:56:17 albertel Exp $
+# $Id: lonnet.pm,v 1.252 2002/07/17 18:01:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2948,13 +2948,17 @@
     while (my $configline=<$config>) {
        chomp($configline);
        my ($id,$domain,$role,$name,$ip,$domdescr)=split(/:/,$configline);
-       $hostname{$id}=$name;
-       $hostdom{$id}=$domain;
-       $hostip{$id}=$ip;
-       if ($domdescr) {
-	   $domaindescription{$domain}=$domdescr;
+       if ($id && $domain && $role && $name && $ip) {
+	 $hostname{$id}=$name;
+	 $hostdom{$id}=$domain;
+	 $hostip{$id}=$ip;
+	 if ($domdescr) { $domaindescription{$domain}=$domdescr; }
+	 if ($role eq 'library') { $libserv{$id}=$name; }
+       } else {
+	 if ($configline) {
+	   &logthis("Skipping hosts.tab line -$configline-");
+	 }
        }
-       if ($role eq 'library') { $libserv{$id}=$name; }
     }
 }