@@ -103,9 +103,6 @@ def validate_pkginfo_key_types(pkginfo, filename):
103103 Used for AutoPkg- and Munki-related hooks.
104104 """
105105
106- # Remap string type to support unicode in both Python 2 and 3
107- string = basestring if sys .version_info .major == 2 else str
108-
109106 # Pkginfo keys and their known types. Omitted keys are left unvalidated.
110107 # Source: https://github.com/munki/munki/wiki/Supported-Pkginfo-Keys
111108 # Last updated 2019-03-13.
@@ -115,58 +112,58 @@ def validate_pkginfo_key_types(pkginfo, filename):
115112 "autoremove" : bool ,
116113 "blocking_applications" : list ,
117114 "catalogs" : list ,
118- "category" : string ,
115+ "category" : str ,
119116 "copy_local" : bool ,
120- "description" : string ,
121- "developer" : string ,
122- "display_name" : string ,
117+ "description" : str ,
118+ "developer" : str ,
119+ "display_name" : str ,
123120 "force_install_after_date" : datetime ,
124121 "forced_install" : bool ,
125122 "forced_uninstall" : bool ,
126- "icon_name" : string ,
127- "installable_condition" : string ,
123+ "icon_name" : str ,
124+ "installable_condition" : str ,
128125 "installed_size" : int ,
129- "installer_item_hash" : string ,
130- "installer_item_location" : string ,
126+ "installer_item_hash" : str ,
127+ "installer_item_location" : str ,
131128 "installer_item_size" : int ,
132- "installer_type" : string ,
129+ "installer_type" : str ,
133130 "installs" : list ,
134131 "items_to_copy" : list ,
135132 "installer_choices_xml" : list ,
136133 "installer_environment" : dict ,
137134 "localized_strings" : dict ,
138- "minimum_munki_version" : string ,
139- "minimum_os_version" : string ,
140- "maximum_os_version" : string ,
141- "name" : string ,
142- "notes" : string ,
143- "PackageCompleteURL" : string ,
144- "PackageURL" : string ,
145- "package_path" : string ,
146- "installcheck_script" : string ,
147- "uninstallcheck_script" : string ,
135+ "minimum_munki_version" : str ,
136+ "minimum_os_version" : str ,
137+ "maximum_os_version" : str ,
138+ "name" : str ,
139+ "notes" : str ,
140+ "PackageCompleteURL" : str ,
141+ "PackageURL" : str ,
142+ "package_path" : str ,
143+ "installcheck_script" : str ,
144+ "uninstallcheck_script" : str ,
148145 "OnDemand" : bool ,
149- "postinstall_script" : string ,
150- "postuninstall_script" : string ,
146+ "postinstall_script" : str ,
147+ "postuninstall_script" : str ,
151148 "precache" : bool ,
152149 "preinstall_alert" : dict ,
153150 "preuninstall_alert" : dict ,
154151 "preupgrade_alert" : dict ,
155- "preinstall_script" : string ,
156- "preuninstall_script" : string ,
152+ "preinstall_script" : str ,
153+ "preuninstall_script" : str ,
157154 "receipts" : list ,
158155 "requires" : list ,
159- "RestartAction" : string ,
156+ "RestartAction" : str ,
160157 "supported_architectures" : list ,
161158 "suppress_bundle_relocation" : bool ,
162159 "unattended_install" : bool ,
163160 "unattended_uninstall" : bool ,
164- "uninstall_method" : string ,
165- "uninstall_script" : string ,
166- "uninstaller_item_location" : string ,
161+ "uninstall_method" : str ,
162+ "uninstall_script" : str ,
163+ "uninstaller_item_location" : str ,
167164 "uninstallable" : bool ,
168165 "update_for" : list ,
169- "version" : string ,
166+ "version" : str ,
170167 }
171168
172169 passed = True
0 commit comments