[LON-CAPA-cvs] cvs: loncom / loncron

raeburn raeburn at source.lon-capa.org
Sat Dec 22 15:05:16 EST 2018


raeburn		Sat Dec 22 20:05:16 2018 EDT

  Modified files:              
    /loncom	loncron 
  Log:
  - Use LWP to retrieve domain configuration from domain's primary library server.
  
  
Index: loncom/loncron
diff -u loncom/loncron:1.115 loncom/loncron:1.116
--- loncom/loncron:1.115	Sat Nov 24 16:19:09 2018
+++ loncom/loncron	Sat Dec 22 20:05:16 2018
@@ -2,7 +2,7 @@
 
 # Housekeeping program, started by cron, loncontrol and loncron.pl
 #
-# $Id: loncron,v 1.115 2018/11/24 16:19:09 raeburn Exp $
+# $Id: loncron,v 1.116 2018/12/22 20:05:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -34,6 +34,7 @@
 use LONCAPA::Configuration;
 use LONCAPA::Checksumming;
 use LONCAPA;
+use LONCAPA::LWPReq;
 use Apache::lonnet;
 use Apache::loncommon;
 
@@ -1123,7 +1124,7 @@
         unless ($protocol eq 'https') {
             $protocol = 'http';
         }
-        $url = $protocol.'://'.$hostname.'/cgi-bin/listdomconfig.pl';
+        $url = $protocol.'://'.$hostname.'/cgi-bin/listdomconfig.pl?primary='.$primlibserv.'&format=raw';
     }
     if ($isprimary) {
         my $lonusersdir = $perlvar{'lonUsersDir'};
@@ -1144,14 +1145,12 @@
             }
         }
     } else {
-        if (open(PIPE,"wget --no-check-certificate '$url?primary=$primlibserv&format=raw' |")) {
-            my $config = '';
-            while (<PIPE>) {
-                $config .= $_;
-            }
-            close(PIPE);
-            if ($config) {
-                my @pairs=split(/\&/,$config);
+        my $request=new HTTP::Request('GET',$url);
+        my $response=&LONCAPA::LWPReq::makerequest($primlibserv,$request,'',\%perlvar,5);
+        unless ($response->is_error()) {
+            my $content = $response->content;
+            if ($content) {
+                my @pairs=split(/\&/,$content);
                 foreach my $item (@pairs) {
                     my ($key,$value)=split(/=/,$item,2);
                     my $what = &LONCAPA::unescape($key);




More information about the LON-CAPA-cvs mailing list