李春阳 1 年之前
父節點
當前提交
f3c0503f8d

+ 2 - 2
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/infra/configuration/kubernetes/KubernetesConfiguration.java

@@ -51,8 +51,8 @@ public class KubernetesConfiguration {
     @SneakyThrows
     public ApiClient apiClient() {
 //        File config = ResourceUtils.getFile("classpath:kubernetes/config");  // 开发环境可用,生产环境不行,无法从jar 包读取
-        File config = new File("E:\\project\\simulation-cloud\\simulation-resource-scheduler\\src\\main\\resources\\kubernetes\\config");  //windows
-//        File config = new File("/root/.kube/config");   //linux
+//        File config = new File("E:\\project\\simulation-cloud\\simulation-resource-scheduler\\src\\main\\resources\\kubernetes\\config");  //windows
+        File config = new File("/root/.kube/config");   //linux
 //
 //        ClassPathResource classPathResource = new ClassPathResource("kubernetes/config");
 //        InputStream inputStream = classPathResource.getInputStream();

+ 6 - 6
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/SceneEvaluationRuleService.java

@@ -89,12 +89,12 @@ public class SceneEvaluationRuleService {
                 return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "非管理员禁止上传文件");
             }
             // 检查文件内容是否合规
-            String pyStr = new String(file.getBytes(), StandardCharsets.UTF_8);
-            //1 校验 python 语法错误
-            String pylint = PythonUtil.pylint(pyStr, PythonUtil.C, PythonUtil.R, PythonUtil.W, PythonUtil.E0401, PythonUtil.E0601);
-            if (!pylint.contains(PythonUtil.PASS)) {
-                return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "代码格式错误,请检查。");
-            }
+//            String pyStr = new String(file.getBytes(), StandardCharsets.UTF_8);
+//            //1 校验 python 语法错误
+//            String pylint = PythonUtil.pylint(pyStr, PythonUtil.C, PythonUtil.R, PythonUtil.W, PythonUtil.E0401, PythonUtil.E0601);
+//            if (!pylint.contains(PythonUtil.PASS)) {
+//                return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "代码格式错误,请检查。");
+//            }
             // 获取文件原本的名字
             String originName = file.getOriginalFilename();
             if (null == originName) {