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

droeschl droeschl at source.lon-capa.org
Thu Aug 25 04:09:34 EDT 2016


droeschl		Thu Aug 25 08:09:34 2016 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Return appropriate error code when retrieving author directories.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1317 loncom/lonnet/perl/lonnet.pm:1.1318
--- loncom/lonnet/perl/lonnet.pm:1.1317	Tue Aug 16 22:10:12 2016
+++ loncom/lonnet/perl/lonnet.pm	Thu Aug 25 08:09:34 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1317 2016/08/16 22:10:12 raeburn Exp $
+# $Id: lonnet.pm,v 1.1318 2016/08/25 08:09:34 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10202,7 +10202,24 @@
             foreach my $user (sort(keys(%allusers))) {
                 push(@alluserslist,$user.'&user');
             }
-            return (\@alluserslist);
+
+            if (!%listerror) {
+                # no errors
+                return (\@alluserslist);
+            } elsif (scalar(keys(%servers)) == 1) {
+                # one library server, one error 
+                my ($key) = keys(%listerror);
+                return (\@alluserslist, $listerror{$key});
+            } elsif ( grep { $_ eq 'con_lost' } values(%listerror) ) {
+                # con_lost indicates that we might miss data from at least one
+                # library server
+                return (\@alluserslist, 'con_lost');
+            } else {
+                # multiple library servers and no con_lost -> data should be
+                # complete. 
+                return (\@alluserslist);
+            }
+
         } else {
             return ([],'missing username');
         }




More information about the LON-CAPA-cvs mailing list