igiguere commented on code in PR #3955:
URL: https://github.com/apache/solr/pull/3955#discussion_r2636100652


##########
solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java:
##########
@@ -142,14 +143,15 @@ public void addRepository(String repoName, String uri) 
throws Exception {
 
   public void addKey(byte[] key, String destinationKeyFilename) throws 
Exception {
     // get solr_home directory from info servlet
-    NamedList<Object> systemInfo =
-        solrClient.request(
-            new GenericSolrRequest(SolrRequest.METHOD.GET, "/solr" + 
SYSTEM_INFO_PATH));
-    String solrHome = (String) systemInfo.get("solr_home");
+    // This method is only called from PackageTool ("add-repo", or "add-key"), 
where the Solr URL is
+    // normalized to remove the /solr path part
+    // So might as well ping the V2 API "/node/system" instead.
+    // Otherwise, this SystemInfoRequest ctr would need to set the full 
/solr/admin/info/system path
+    SystemInfoResponse sysResponse = new 
SystemInfoRequest("/node/system").process(solrClient);

Review Comment:
   I was going to set the V2 path /node/system as default in SystemInfoRequest 
constructors, but, that would require some refactoring throughout the CLI 
tools, at least.  The SolrClient used for the system info can be reused for 
other request that don't all support V2, so, having SystemInfoRequest default 
to V2 would mean managing the switch from V1 to V2 URLs.
   Let's takle that in some other ticket.  I'm leaving a "TODO" for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to