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

raeburn raeburn at source.lon-capa.org
Wed May 30 12:57:07 EDT 2012


raeburn		Wed May 30 16:57:07 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11.
    - Backport 1.1175.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.3 loncom/lonnet/perl/lonnet.pm:1.1172.2.4
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.3	Tue May 29 12:16:42 2012
+++ loncom/lonnet/perl/lonnet.pm	Wed May 30 16:57:06 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.3 2012/05/29 12:16:42 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.4 2012/05/30 16:57:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1236,6 +1236,7 @@
     my ($is_balancer,$dom_in_use,$homeintdom,$rule_in_effect,
         $offloadto,$otherserver);
     my $lonhost = $perlvar{'lonHostID'};
+    my @hosts = &current_machine_ids();
     my $uprimary_id = &Apache::lonnet::domain($udom,'primary');
     my $uintdom = &Apache::lonnet::internet_dom($uprimary_id);
     my $intdom = &Apache::lonnet::internet_dom($lonhost);
@@ -1262,7 +1263,6 @@
         my $currtargets = $result->{'targets'};
         my $currrules = $result->{'rules'};
         if ($currbalancer ne '') {
-            my @hosts = &current_machine_ids();
             if (grep(/^\Q$currbalancer\E$/, at hosts)) {
                 $is_balancer = 1;
             }
@@ -1378,13 +1378,18 @@
             }
         }
     }
+    if (($otherserver ne '') && (grep(/^\Q$otherserver\E$/, at hosts))) {
+        $is_balancer = 0;
+    }
     return ($is_balancer,$otherserver);
 }
 
 sub get_loadbalancer_targets {
     my ($rule_in_effect,$currtargets,$uname,$udom) = @_;
     my $offloadto;
-    if ($rule_in_effect eq '') {
+    if ($rule_in_effect eq 'none') {
+        return [$perlvar{'lonHostID'}];
+    } elsif ($rule_in_effect eq '') {
         $offloadto = $currtargets;
     } else {
         if ($rule_in_effect eq 'homeserver') {




More information about the LON-CAPA-cvs mailing list