@@ -391,44 +391,17 @@ def validate_proc_type_conventions(process, filename):
391391
392392 # For each processor type, this is the list of processors that
393393 # we only expect to see in that type. List order is unimportant.
394- # TODO: Simpler to check for `com.github.grahampugh.jamf-upload.processors/` prefix?
395- jamf_upload_procs = [
396- "com.github.grahampugh.jamf-upload.processors/JamfAccountUploader" ,
397- "com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader" ,
398- "com.github.grahampugh.jamf-upload.processors/JamfClassicAPIObjectUploader" ,
399- "com.github.grahampugh.jamf-upload.processors/JamfComputerGroupDeleter" ,
400- "com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader" ,
401- "com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader" ,
402- "com.github.grahampugh.jamf-upload.processors/JamfDockItemUploader" ,
403- "com.github.grahampugh.jamf-upload.processors/JamfExtensionAttributeUploader" ,
404- "com.github.grahampugh.jamf-upload.processors/JamfIconUploader" ,
405- "com.github.grahampugh.jamf-upload.processors/JamfMacAppUploader" ,
406- "com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceGroupUploader" ,
407- "com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceProfileUploader" ,
408- "com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner" ,
409- "com.github.grahampugh.jamf-upload.processors/JamfPackageRecalculator" ,
410- "com.github.grahampugh.jamf-upload.processors/JamfPackageUploader" ,
411- "com.github.grahampugh.jamf-upload.processors/JamfPatchChecker" ,
412- "com.github.grahampugh.jamf-upload.processors/JamfPatchUploader" ,
413- "com.github.grahampugh.jamf-upload.processors/JamfPkgMetadataUploader" ,
414- "com.github.grahampugh.jamf-upload.processors/JamfPolicyDeleter" ,
415- "com.github.grahampugh.jamf-upload.processors/JamfPolicyLogFlusher" ,
416- "com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader" ,
417- "com.github.grahampugh.jamf-upload.processors/JamfScriptUploader" ,
418- "com.github.grahampugh.jamf-upload.processors/JamfSoftwareRestrictionUploader" ,
419- "com.github.grahampugh.jamf-upload.processors/JamfUploaderSlacker" ,
420- "com.github.grahampugh.jamf-upload.processors/JamfUploaderTeamsNotifier" ,
421- ]
422394 proc_type_conventions = {
423- "download" : [
395+ # Tuple contains all recipe types that share these conventions.
396+ ("download" ,): [
424397 "SparkleUpdateInfoProvider" ,
425398 "GitHubReleasesInfoProvider" ,
426399 "URLDownloader" ,
427400 "URLDownloaderPython" ,
428401 "CURLDownloader" ,
429402 "EndOfCheckPhase" ,
430403 ],
431- "munki" : [
404+ ( "munki" ,) : [
432405 "MunkiInfoCreator" ,
433406 "MunkiInstallsItemsCreator" ,
434407 "MunkiPkginfoMerger" ,
@@ -437,15 +410,40 @@ def validate_proc_type_conventions(process, filename):
437410 "MunkiOptionalReceiptEditor" ,
438411 "MunkiImporter" ,
439412 ],
440- "pkg" : ["AppPkgCreator" , "PkgCreator" ],
441- "install" : ["InstallFromDMG" , "Installer" ],
413+ ( "pkg" ,) : ["AppPkgCreator" , "PkgCreator" ],
414+ ( "install" ,) : ["InstallFromDMG" , "Installer" ],
442415 # https://github.com/jssimporter/JSSImporter
443- "jss" : ["JSSImporter" ],
416+ ( "jss" ,) : ["JSSImporter" ],
444417 # https://github.com/grahampugh/jamf-upload
445- "jamf" : jamf_upload_procs ,
446- "jamf-upload" : jamf_upload_procs ,
418+ ("jamf" , "jamf-upload" ): [
419+ "com.github.grahampugh.jamf-upload.processors/JamfAccountUploader" ,
420+ "com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader" ,
421+ "com.github.grahampugh.jamf-upload.processors/JamfClassicAPIObjectUploader" ,
422+ "com.github.grahampugh.jamf-upload.processors/JamfComputerGroupDeleter" ,
423+ "com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader" ,
424+ "com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader" ,
425+ "com.github.grahampugh.jamf-upload.processors/JamfDockItemUploader" ,
426+ "com.github.grahampugh.jamf-upload.processors/JamfExtensionAttributeUploader" ,
427+ "com.github.grahampugh.jamf-upload.processors/JamfIconUploader" ,
428+ "com.github.grahampugh.jamf-upload.processors/JamfMacAppUploader" ,
429+ "com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceGroupUploader" ,
430+ "com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceProfileUploader" ,
431+ "com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner" ,
432+ "com.github.grahampugh.jamf-upload.processors/JamfPackageRecalculator" ,
433+ "com.github.grahampugh.jamf-upload.processors/JamfPackageUploader" ,
434+ "com.github.grahampugh.jamf-upload.processors/JamfPatchChecker" ,
435+ "com.github.grahampugh.jamf-upload.processors/JamfPatchUploader" ,
436+ "com.github.grahampugh.jamf-upload.processors/JamfPkgMetadataUploader" ,
437+ "com.github.grahampugh.jamf-upload.processors/JamfPolicyDeleter" ,
438+ "com.github.grahampugh.jamf-upload.processors/JamfPolicyLogFlusher" ,
439+ "com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader" ,
440+ "com.github.grahampugh.jamf-upload.processors/JamfScriptUploader" ,
441+ "com.github.grahampugh.jamf-upload.processors/JamfSoftwareRestrictionUploader" ,
442+ "com.github.grahampugh.jamf-upload.processors/JamfUploaderSlacker" ,
443+ "com.github.grahampugh.jamf-upload.processors/JamfUploaderTeamsNotifier" ,
444+ ],
447445 # https://github.com/autopkg/filewave
448- "filewave" : [
446+ ( "filewave" ,) : [
449447 "com.github.autopkg.filewave.FWTool/FileWaveImporter" ,
450448 "com.github.johncclayton.filewave.FWTool/FileWaveImporter" ,
451449 "com.github.autopkg.filewave.FWTool/FWTool" ,
@@ -454,11 +452,11 @@ def validate_proc_type_conventions(process, filename):
454452
455453 passed = True
456454 processors = [x .get ("Processor" ) for x in process ]
457- for recipe_type in proc_type_conventions :
458- type_hint = f".{ recipe_type } ."
459- if type_hint not in filename :
455+ for recipe_group in proc_type_conventions :
456+ type_hints = [ f".{ recipe_type } ." for recipe_type in recipe_group ]
457+ if not any ( th in filename for th in type_hints ) :
460458 for processor in processors :
461- if processor in proc_type_conventions [recipe_type ]:
459+ if processor in proc_type_conventions [recipe_group ]:
462460 print (
463461 f"{ filename } : Processor { processor } is not conventional for this "
464462 "recipe type."
0 commit comments