smolnar82 commented on a change in pull request #239: KNOX-2153 - CM discovery 
- Monitor Cloudera Manager
URL: https://github.com/apache/knox/pull/239#discussion_r368886079
 
 

 ##########
 File path: 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/oozie/OozieServiceModelGenerator.java
 ##########
 @@ -59,15 +63,22 @@ public ServiceModel generateService(ApiService       
service,
     String hostname = role.getHostRef().getHostname();
     String scheme;
     String port;
-    boolean sslEnabled = 
Boolean.parseBoolean(getServiceConfigValue(serviceConfig, "oozie_use_ssl"));
-    if(sslEnabled) {
+    String sslEnabled = getServiceConfigValue(serviceConfig, USE_SSL);
+    if(Boolean.parseBoolean(sslEnabled)) {
       scheme = "https";
-      port = getRoleConfigValue(roleConfig, "oozie_https_port");
+      port = getRoleConfigValue(roleConfig, HTTPS_PORT);
     } else {
       scheme = "http";
-      port = getRoleConfigValue(roleConfig, "oozie_http_port");
+      port = getRoleConfigValue(roleConfig, HTTP_PORT);
     }
 
 Review comment:
   This is a recurring code in many of the different service implementation. 
You may consider implementing a method in `AbstractServiceModelGenerator` which 
returns the correct scheme and the port.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to