Skip to content

Commit 71dbf6d

Browse files
committed
updating include_file
Signed-off-by: Vanessa Sochat <[email protected]>
1 parent ef59f0d commit 71dbf6d

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

singularity/analysis/reproduce/criteria.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ def include_file(member_path, file_filter):
4040

4141
# Regular expression?
4242
if "regexp" in file_filter:
43-
if file_filter['regexp'] is not None and member_path is not None:
44-
try:
45-
if re.search(file_filter["regexp"], member_path):
46-
return True
47-
except:
48-
print(member_path)
49-
print(file_filter)
43+
if re.search(file_filter["regexp"], member_path):
44+
return True
5045
return False
5146

5247

singularity/analysis/reproduce/hash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ def get_image_hash(image_path,
122122
# For files, we either assess content, or include the file
123123
if member.isdir() or member.issym():
124124
continue
125-
elif assess_content(member,file_filter):
126-
content = extract_content(image_path,member.name)
125+
elif assess_content(member, file_filter):
126+
content = extract_content(image_path, member.name)
127127
hasher.update(content)
128-
elif include_file(member,file_filter):
128+
elif include_file(member.name, file_filter):
129129
buf = member.tobuf()
130130
hasher.update(buf)
131131

0 commit comments

Comments
 (0)