calvinjiang commented on a change in pull request #6082:
URL: https://github.com/apache/dolphinscheduler/pull/6082#discussion_r703116373



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/PythonCommandExecutor.java
##########
@@ -185,4 +190,34 @@ public static String getPythonHome(String envPath) {
         return null;
     }
 
+    /**
+     * get python home from the environment config
+     *
+     * @param environmentConfig env config
+     * @return python home
+     */
+    public static String getPythonHomeFromEnvironmentConfig(String 
environmentConfig) {
+        BufferedReader br = null;
+        StringBuilder sb = new StringBuilder();
+
+        String[] lines = environmentConfig.split("\n");
+
+        for (String line : lines) {
+            if (StringUtils.isNotEmpty(StringUtils.trim(line))) {
+                if (line.contains(Constants.PYTHON_HOME)) {
+                    sb.append(line);

Review comment:
       done




-- 
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]


Reply via email to