Skip to content

Commit bb51cf7

Browse files
committed
Fix traceback when checking "nopkg" type items in Munki
Follow up to #66
1 parent 26bd432 commit bb51cf7

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

pre_commit_hooks/check_munki_pkgsinfo.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def build_argument_parser():
3939

4040

4141
def _check_case_sensitive_path(path):
42+
"""Check whether a path exists, and on case-sensitive filesystems check
43+
that there is no case conflict."""
4244
# Return immediately if the file does not exist
4345
if not os.path.exists(path):
4446
return False
@@ -131,14 +133,9 @@ def main(argv=None):
131133
)
132134
retval = 1
133135

134-
# Check for missing installer items
135-
if all(
136-
(
137-
"installer_item_location" in pkginfo,
138-
not _check_case_sensitive_path(
139-
os.path.join("pkgs", pkginfo.get("installer_item_location"))
140-
),
141-
)
136+
# Check for missing or case-conflicted installer items
137+
if not _check_case_sensitive_path(
138+
os.path.join("pkgs", pkginfo.get("installer_item_location", ""))
142139
):
143140
print(
144141
"{}: installer item does not exist or path is not case sensitive".format(

0 commit comments

Comments
 (0)