Skip to content

Commit

Permalink
control-service: exclude pyc files from dj validation (#2492)
Browse files Browse the repository at this point in the history
Why
We have received a lot of complaints from your internal customers.

What
Exclude .pyc files from the data job validation process.

Signed-off-by: Miroslav Ivanov [email protected]

---------

Signed-off-by: Miroslav Ivanov [email protected]
Co-authored-by: github-actions <>
  • Loading branch information
mivanov1988 authored Jul 27, 2023
1 parent c3567a9 commit 48f64e3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package com.vmware.taurus.service.upload;

import com.vmware.taurus.exception.ExternalSystemError;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -75,7 +76,8 @@ private void validateAllowedFiles(String jobName, Path jobDirectory) {
*/
private void validateFile(String jobName, Path filePath, Path pathInsideJob)
throws InvalidJobUpload {
if (filePath.toFile().isDirectory()) {
if (filePath.toFile().isDirectory()
|| "pyc".equals(FilenameUtils.getExtension(filePath.getFileName().toString()))) {
return;
}
try {
Expand Down

0 comments on commit 48f64e3

Please sign in to comment.