patchman 4.0.17__tar.gz → 4.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. {patchman-4.0.17 → patchman-4.0.18}/PKG-INFO +1 -1
  2. patchman-4.0.18/VERSION.txt +1 -0
  3. {patchman-4.0.17 → patchman-4.0.18}/hosts/models.py +12 -4
  4. {patchman-4.0.17 → patchman-4.0.18}/patchman/settings.py +7 -0
  5. {patchman-4.0.17 → patchman-4.0.18}/patchman.egg-info/PKG-INFO +1 -1
  6. {patchman-4.0.17 → patchman-4.0.18}/patchman.egg-info/SOURCES.txt +1 -0
  7. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_parsing.py +59 -0
  8. {patchman-4.0.17 → patchman-4.0.18}/reports/utils.py +22 -18
  9. patchman-4.0.18/repos/tests/test_views.py +114 -0
  10. {patchman-4.0.17 → patchman-4.0.18}/repos/views.py +2 -2
  11. patchman-4.0.17/VERSION.txt +0 -1
  12. {patchman-4.0.17 → patchman-4.0.18}/AUTHORS +0 -0
  13. {patchman-4.0.17 → patchman-4.0.18}/COPYING +0 -0
  14. {patchman-4.0.17 → patchman-4.0.18}/INSTALL.md +0 -0
  15. {patchman-4.0.17 → patchman-4.0.18}/MANIFEST.in +0 -0
  16. {patchman-4.0.17 → patchman-4.0.18}/README.md +0 -0
  17. {patchman-4.0.17 → patchman-4.0.18}/arch/__init__.py +0 -0
  18. {patchman-4.0.17 → patchman-4.0.18}/arch/admin.py +0 -0
  19. {patchman-4.0.17 → patchman-4.0.18}/arch/apps.py +0 -0
  20. {patchman-4.0.17 → patchman-4.0.18}/arch/migrations/0001_initial.py +0 -0
  21. {patchman-4.0.17 → patchman-4.0.18}/arch/migrations/0002_alter_machinearchitecture_options_and_more.py +0 -0
  22. {patchman-4.0.17 → patchman-4.0.18}/arch/migrations/__init__.py +0 -0
  23. {patchman-4.0.17 → patchman-4.0.18}/arch/models.py +0 -0
  24. {patchman-4.0.17 → patchman-4.0.18}/arch/serializers.py +0 -0
  25. {patchman-4.0.17 → patchman-4.0.18}/arch/tests/__init__.py +0 -0
  26. {patchman-4.0.17 → patchman-4.0.18}/arch/tests/test_api.py +0 -0
  27. {patchman-4.0.17 → patchman-4.0.18}/arch/tests/test_models.py +0 -0
  28. {patchman-4.0.17 → patchman-4.0.18}/arch/utils.py +0 -0
  29. {patchman-4.0.17 → patchman-4.0.18}/arch/views.py +0 -0
  30. {patchman-4.0.17 → patchman-4.0.18}/domains/__init__.py +0 -0
  31. {patchman-4.0.17 → patchman-4.0.18}/domains/admin.py +0 -0
  32. {patchman-4.0.17 → patchman-4.0.18}/domains/apps.py +0 -0
  33. {patchman-4.0.17 → patchman-4.0.18}/domains/migrations/0001_initial.py +0 -0
  34. {patchman-4.0.17 → patchman-4.0.18}/domains/migrations/0002_alter_domain_options.py +0 -0
  35. {patchman-4.0.17 → patchman-4.0.18}/domains/migrations/__init__.py +0 -0
  36. {patchman-4.0.17 → patchman-4.0.18}/domains/models.py +0 -0
  37. {patchman-4.0.17 → patchman-4.0.18}/domains/serializers.py +0 -0
  38. {patchman-4.0.17 → patchman-4.0.18}/domains/tests/__init__.py +0 -0
  39. {patchman-4.0.17 → patchman-4.0.18}/domains/tests/test_api.py +0 -0
  40. {patchman-4.0.17 → patchman-4.0.18}/domains/tests/test_models.py +0 -0
  41. {patchman-4.0.17 → patchman-4.0.18}/domains/views.py +0 -0
  42. {patchman-4.0.17 → patchman-4.0.18}/errata/__init__.py +0 -0
  43. {patchman-4.0.17 → patchman-4.0.18}/errata/admin.py +0 -0
  44. {patchman-4.0.17 → patchman-4.0.18}/errata/apps.py +0 -0
  45. {patchman-4.0.17 → patchman-4.0.18}/errata/managers.py +0 -0
  46. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0001_initial.py +0 -0
  47. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0002_alter_erratumreference_unique_together.py +0 -0
  48. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0003_delete_erratumreference_alter_erratum_references.py +0 -0
  49. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0004_rename_packages_erratum_fixed_packages.py +0 -0
  50. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0005_erratum_affected_packages_and_more.py +0 -0
  51. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0006_alter_erratum_options.py +0 -0
  52. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0007_alter_erratum_fixed_packages.py +0 -0
  53. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0008_add_cached_count_fields.py +0 -0
  54. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/0009_backfill_cached_counts.py +0 -0
  55. {patchman-4.0.17 → patchman-4.0.18}/errata/migrations/__init__.py +0 -0
  56. {patchman-4.0.17 → patchman-4.0.18}/errata/models.py +0 -0
  57. {patchman-4.0.17 → patchman-4.0.18}/errata/serializers.py +0 -0
  58. {patchman-4.0.17 → patchman-4.0.18}/errata/signals.py +0 -0
  59. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/__init__.py +0 -0
  60. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/__init__.py +0 -0
  61. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/alma.py +0 -0
  62. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/arch.py +0 -0
  63. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/centos.py +0 -0
  64. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/debian.py +0 -0
  65. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/rocky.py +0 -0
  66. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/distros/ubuntu.py +0 -0
  67. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/repos/__init__.py +0 -0
  68. {patchman-4.0.17 → patchman-4.0.18}/errata/sources/repos/yum.py +0 -0
  69. {patchman-4.0.17 → patchman-4.0.18}/errata/tables.py +0 -0
  70. {patchman-4.0.17 → patchman-4.0.18}/errata/tasks.py +0 -0
  71. {patchman-4.0.17 → patchman-4.0.18}/errata/templates/errata/erratum_detail.html +0 -0
  72. {patchman-4.0.17 → patchman-4.0.18}/errata/templates/errata/erratum_list.html +0 -0
  73. {patchman-4.0.17 → patchman-4.0.18}/errata/tests/__init__.py +0 -0
  74. {patchman-4.0.17 → patchman-4.0.18}/errata/tests/test_api.py +0 -0
  75. {patchman-4.0.17 → patchman-4.0.18}/errata/tests/test_integration.py +0 -0
  76. {patchman-4.0.17 → patchman-4.0.18}/errata/tests/test_models.py +0 -0
  77. {patchman-4.0.17 → patchman-4.0.18}/errata/urls.py +0 -0
  78. {patchman-4.0.17 → patchman-4.0.18}/errata/utils.py +0 -0
  79. {patchman-4.0.17 → patchman-4.0.18}/errata/views.py +0 -0
  80. {patchman-4.0.17 → patchman-4.0.18}/etc/patchman/apache.conf.example +0 -0
  81. {patchman-4.0.17 → patchman-4.0.18}/etc/patchman/celery.conf +0 -0
  82. {patchman-4.0.17 → patchman-4.0.18}/etc/patchman/local_settings.py +0 -0
  83. {patchman-4.0.17 → patchman-4.0.18}/etc/systemd/system/patchman-celery-beat.service +0 -0
  84. {patchman-4.0.17 → patchman-4.0.18}/etc/systemd/system/patchman-celery-worker@.service +0 -0
  85. {patchman-4.0.17 → patchman-4.0.18}/hosts/__init__.py +0 -0
  86. {patchman-4.0.17 → patchman-4.0.18}/hosts/admin.py +0 -0
  87. {patchman-4.0.17 → patchman-4.0.18}/hosts/apps.py +0 -0
  88. {patchman-4.0.17 → patchman-4.0.18}/hosts/forms.py +0 -0
  89. {patchman-4.0.17 → patchman-4.0.18}/hosts/managers.py +0 -0
  90. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0001_initial.py +0 -0
  91. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0002_initial.py +0 -0
  92. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0003_host_modules.py +0 -0
  93. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0004_remove_host_tags_host_tags.py +0 -0
  94. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0005_rename_os_host_osvariant.py +0 -0
  95. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0006_migrate_to_tz_aware.py +0 -0
  96. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0007_alter_host_tags.py +0 -0
  97. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0008_alter_host_options.py +0 -0
  98. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0009_host_errata.py +0 -0
  99. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0010_alter_hostrepo_options.py +0 -0
  100. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0011_host_bug_updates_count_host_errata_count_and_more.py +0 -0
  101. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/0012_backfill_cached_counts.py +0 -0
  102. {patchman-4.0.17 → patchman-4.0.18}/hosts/migrations/__init__.py +0 -0
  103. {patchman-4.0.17 → patchman-4.0.18}/hosts/serializers.py +0 -0
  104. {patchman-4.0.17 → patchman-4.0.18}/hosts/signals.py +0 -0
  105. {patchman-4.0.17 → patchman-4.0.18}/hosts/tables.py +0 -0
  106. {patchman-4.0.17 → patchman-4.0.18}/hosts/tasks.py +0 -0
  107. {patchman-4.0.17 → patchman-4.0.18}/hosts/templates/hosts/host_delete.html +0 -0
  108. {patchman-4.0.17 → patchman-4.0.18}/hosts/templates/hosts/host_detail.html +0 -0
  109. {patchman-4.0.17 → patchman-4.0.18}/hosts/templates/hosts/host_edit.html +0 -0
  110. {patchman-4.0.17 → patchman-4.0.18}/hosts/templates/hosts/host_list.html +0 -0
  111. {patchman-4.0.17 → patchman-4.0.18}/hosts/templatetags/__init__.py +0 -0
  112. {patchman-4.0.17 → patchman-4.0.18}/hosts/templatetags/report_alert.py +0 -0
  113. {patchman-4.0.17 → patchman-4.0.18}/hosts/tests/__init__.py +0 -0
  114. {patchman-4.0.17 → patchman-4.0.18}/hosts/tests/test_api.py +0 -0
  115. {patchman-4.0.17 → patchman-4.0.18}/hosts/tests/test_find_updates.py +0 -0
  116. {patchman-4.0.17 → patchman-4.0.18}/hosts/tests/test_managers.py +0 -0
  117. {patchman-4.0.17 → patchman-4.0.18}/hosts/tests/test_models.py +0 -0
  118. {patchman-4.0.17 → patchman-4.0.18}/hosts/urls.py +0 -0
  119. {patchman-4.0.17 → patchman-4.0.18}/hosts/utils.py +0 -0
  120. {patchman-4.0.17 → patchman-4.0.18}/hosts/views.py +0 -0
  121. {patchman-4.0.17 → patchman-4.0.18}/modules/__init__.py +0 -0
  122. {patchman-4.0.17 → patchman-4.0.18}/modules/admin.py +0 -0
  123. {patchman-4.0.17 → patchman-4.0.18}/modules/apps.py +0 -0
  124. {patchman-4.0.17 → patchman-4.0.18}/modules/managers.py +0 -0
  125. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0001_initial.py +0 -0
  126. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0002_auto_20240204_2214.py +0 -0
  127. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0003_alter_module_options.py +0 -0
  128. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0004_alter_module_options.py +0 -0
  129. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0005_alter_module_unique_together.py +0 -0
  130. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/0006_alter_module_context_alter_module_name_and_more.py +0 -0
  131. {patchman-4.0.17 → patchman-4.0.18}/modules/migrations/__init__.py +0 -0
  132. {patchman-4.0.17 → patchman-4.0.18}/modules/models.py +0 -0
  133. {patchman-4.0.17 → patchman-4.0.18}/modules/serializers.py +0 -0
  134. {patchman-4.0.17 → patchman-4.0.18}/modules/tables.py +0 -0
  135. {patchman-4.0.17 → patchman-4.0.18}/modules/templates/modules/module_detail.html +0 -0
  136. {patchman-4.0.17 → patchman-4.0.18}/modules/templates/modules/module_list.html +0 -0
  137. {patchman-4.0.17 → patchman-4.0.18}/modules/urls.py +0 -0
  138. {patchman-4.0.17 → patchman-4.0.18}/modules/utils.py +0 -0
  139. {patchman-4.0.17 → patchman-4.0.18}/modules/views.py +0 -0
  140. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/__init__.py +0 -0
  141. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/admin.py +0 -0
  142. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/apps.py +0 -0
  143. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/fixtures/os.json +0 -0
  144. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/fixtures/osgroup.json +0 -0
  145. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/forms.py +0 -0
  146. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/managers.py +0 -0
  147. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0001_initial.py +0 -0
  148. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0002_initial.py +0 -0
  149. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0003_os_arch.py +0 -0
  150. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0003_osgroup_codename.py +0 -0
  151. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0004_alter_osgroup_unique_together.py +0 -0
  152. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0005_rename_osgroup_osrelease_rename_os_osvariant_and_more.py +0 -0
  153. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0006_osrelease_cpe_name_osvariant_codename.py +0 -0
  154. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0007_alter_osrelease_unique_together.py +0 -0
  155. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0008_alter_osrelease_options_alter_osvariant_options.py +0 -0
  156. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0009_osvariant_hosts_count.py +0 -0
  157. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0010_backfill_osvariant_counts.py +0 -0
  158. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/0011_alter_osrelease_codename_alter_osrelease_cpe_name_and_more.py +0 -0
  159. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/migrations/__init__.py +0 -0
  160. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/models.py +0 -0
  161. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/serializers.py +0 -0
  162. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/signals.py +0 -0
  163. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/tables.py +0 -0
  164. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/os_landing.html +0 -0
  165. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osrelease_delete.html +0 -0
  166. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osrelease_detail.html +0 -0
  167. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osrelease_list.html +0 -0
  168. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osvariant_delete.html +0 -0
  169. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osvariant_delete_multiple.html +0 -0
  170. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osvariant_detail.html +0 -0
  171. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/templates/operatingsystems/osvariant_list.html +0 -0
  172. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/tests/__init__.py +0 -0
  173. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/tests/test_api.py +0 -0
  174. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/tests/test_models.py +0 -0
  175. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/urls.py +0 -0
  176. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/utils.py +0 -0
  177. {patchman-4.0.17 → patchman-4.0.18}/operatingsystems/views.py +0 -0
  178. {patchman-4.0.17 → patchman-4.0.18}/packages/__init__.py +0 -0
  179. {patchman-4.0.17 → patchman-4.0.18}/packages/admin.py +0 -0
  180. {patchman-4.0.17 → patchman-4.0.18}/packages/apps.py +0 -0
  181. {patchman-4.0.17 → patchman-4.0.18}/packages/managers.py +0 -0
  182. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0001_initial.py +0 -0
  183. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0002_auto_20250207_1319.py +0 -0
  184. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0002_delete_erratum_delete_erratumreference.py +0 -0
  185. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0003_auto_20250207_1746.py +0 -0
  186. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0004_alter_package_options_alter_packagecategory_options_and_more.py +0 -0
  187. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0005_alter_package_packagetype.py +0 -0
  188. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0006_alter_packageupdate_options.py +0 -0
  189. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/0007_alter_package_epoch_alter_package_release_and_more.py +0 -0
  190. {patchman-4.0.17 → patchman-4.0.18}/packages/migrations/__init__.py +0 -0
  191. {patchman-4.0.17 → patchman-4.0.18}/packages/models.py +0 -0
  192. {patchman-4.0.17 → patchman-4.0.18}/packages/serializers.py +0 -0
  193. {patchman-4.0.17 → patchman-4.0.18}/packages/tables.py +0 -0
  194. {patchman-4.0.17 → patchman-4.0.18}/packages/templates/packages/package_detail.html +0 -0
  195. {patchman-4.0.17 → patchman-4.0.18}/packages/templates/packages/package_list.html +0 -0
  196. {patchman-4.0.17 → patchman-4.0.18}/packages/templates/packages/package_name_detail.html +0 -0
  197. {patchman-4.0.17 → patchman-4.0.18}/packages/templates/packages/package_name_list.html +0 -0
  198. {patchman-4.0.17 → patchman-4.0.18}/packages/tests/__init__.py +0 -0
  199. {patchman-4.0.17 → patchman-4.0.18}/packages/tests/test_api.py +0 -0
  200. {patchman-4.0.17 → patchman-4.0.18}/packages/tests/test_models.py +0 -0
  201. {patchman-4.0.17 → patchman-4.0.18}/packages/tests/test_version_compare.py +0 -0
  202. {patchman-4.0.17 → patchman-4.0.18}/packages/urls.py +0 -0
  203. {patchman-4.0.17 → patchman-4.0.18}/packages/utils.py +0 -0
  204. {patchman-4.0.17 → patchman-4.0.18}/packages/views.py +0 -0
  205. {patchman-4.0.17 → patchman-4.0.18}/patchman/__init__.py +0 -0
  206. {patchman-4.0.17 → patchman-4.0.18}/patchman/celery.py +0 -0
  207. {patchman-4.0.17 → patchman-4.0.18}/patchman/receivers.py +0 -0
  208. {patchman-4.0.17 → patchman-4.0.18}/patchman/signals.py +0 -0
  209. {patchman-4.0.17 → patchman-4.0.18}/patchman/sqlite3/base.py +0 -0
  210. {patchman-4.0.17 → patchman-4.0.18}/patchman/static/css/base.css +0 -0
  211. {patchman-4.0.17 → patchman-4.0.18}/patchman/static/js/expandable-text.js +0 -0
  212. {patchman-4.0.17 → patchman-4.0.18}/patchman/static/js/sidebar.js +0 -0
  213. {patchman-4.0.17 → patchman-4.0.18}/patchman/urls.py +0 -0
  214. {patchman-4.0.17 → patchman-4.0.18}/patchman/wsgi.py +0 -0
  215. {patchman-4.0.17 → patchman-4.0.18}/patchman.egg-info/dependency_links.txt +0 -0
  216. {patchman-4.0.17 → patchman-4.0.18}/patchman.egg-info/requires.txt +0 -0
  217. {patchman-4.0.17 → patchman-4.0.18}/patchman.egg-info/top_level.txt +0 -0
  218. {patchman-4.0.17 → patchman-4.0.18}/reports/__init__.py +0 -0
  219. {patchman-4.0.17 → patchman-4.0.18}/reports/admin.py +0 -0
  220. {patchman-4.0.17 → patchman-4.0.18}/reports/apps.py +0 -0
  221. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/0001_initial.py +0 -0
  222. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/0002_report_modules.py +0 -0
  223. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/0003_remove_report_accessed.py +0 -0
  224. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/0004_migrate_to_tz_aware.py +0 -0
  225. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/0005_alter_report_options.py +0 -0
  226. {patchman-4.0.17 → patchman-4.0.18}/reports/migrations/__init__.py +0 -0
  227. {patchman-4.0.17 → patchman-4.0.18}/reports/models.py +0 -0
  228. {patchman-4.0.17 → patchman-4.0.18}/reports/serializers.py +0 -0
  229. {patchman-4.0.17 → patchman-4.0.18}/reports/tables.py +0 -0
  230. {patchman-4.0.17 → patchman-4.0.18}/reports/tasks.py +0 -0
  231. {patchman-4.0.17 → patchman-4.0.18}/reports/templates/reports/report.txt +0 -0
  232. {patchman-4.0.17 → patchman-4.0.18}/reports/templates/reports/report_delete.html +0 -0
  233. {patchman-4.0.17 → patchman-4.0.18}/reports/templates/reports/report_detail.html +0 -0
  234. {patchman-4.0.17 → patchman-4.0.18}/reports/templates/reports/report_list.html +0 -0
  235. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/__init__.py +0 -0
  236. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_api.py +0 -0
  237. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_edge_cases.py +0 -0
  238. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_integration.py +0 -0
  239. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_models.py +0 -0
  240. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_serializers.py +0 -0
  241. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_tasks.py +0 -0
  242. {patchman-4.0.17 → patchman-4.0.18}/reports/tests/test_utils.py +0 -0
  243. {patchman-4.0.17 → patchman-4.0.18}/reports/urls.py +0 -0
  244. {patchman-4.0.17 → patchman-4.0.18}/reports/views.py +0 -0
  245. {patchman-4.0.17 → patchman-4.0.18}/repos/__init__.py +0 -0
  246. {patchman-4.0.17 → patchman-4.0.18}/repos/admin.py +0 -0
  247. {patchman-4.0.17 → patchman-4.0.18}/repos/apps.py +0 -0
  248. {patchman-4.0.17 → patchman-4.0.18}/repos/forms.py +0 -0
  249. {patchman-4.0.17 → patchman-4.0.18}/repos/managers.py +0 -0
  250. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0001_initial.py +0 -0
  251. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0002_alter_repository_repotype.py +0 -0
  252. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0003_migrate_to_tz_aware.py +0 -0
  253. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0004_rename_file_checksum_mirror_package_checksum.py +0 -0
  254. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0005_rename_package_checksum_mirror_packages_checksum.py +0 -0
  255. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0006_mirror_errata_checksum_mirror_modules_checksum.py +0 -0
  256. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0007_alter_mirror_options_alter_mirrorpackage_options_and_more.py +0 -0
  257. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0008_mirror_packages_count.py +0 -0
  258. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/0009_backfill_mirror_counts.py +0 -0
  259. {patchman-4.0.17 → patchman-4.0.18}/repos/migrations/__init__.py +0 -0
  260. {patchman-4.0.17 → patchman-4.0.18}/repos/models.py +0 -0
  261. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/__init__.py +0 -0
  262. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/arch.py +0 -0
  263. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/deb.py +0 -0
  264. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/gentoo.py +0 -0
  265. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/rpm.py +0 -0
  266. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/yast.py +0 -0
  267. {patchman-4.0.17 → patchman-4.0.18}/repos/repo_types/yum.py +0 -0
  268. {patchman-4.0.17 → patchman-4.0.18}/repos/serializers.py +0 -0
  269. {patchman-4.0.17 → patchman-4.0.18}/repos/signals.py +0 -0
  270. {patchman-4.0.17 → patchman-4.0.18}/repos/tables.py +0 -0
  271. {patchman-4.0.17 → patchman-4.0.18}/repos/tasks.py +0 -0
  272. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/mirror_delete.html +0 -0
  273. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/mirror_detail.html +0 -0
  274. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/mirror_edit.html +0 -0
  275. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/mirror_list.html +0 -0
  276. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/mirror_with_repo_list.html +0 -0
  277. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/repo_delete.html +0 -0
  278. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/repo_detail.html +0 -0
  279. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/repo_edit.html +0 -0
  280. {patchman-4.0.17 → patchman-4.0.18}/repos/templates/repos/repo_list.html +0 -0
  281. {patchman-4.0.17 → patchman-4.0.18}/repos/templatetags/__init__.py +0 -0
  282. {patchman-4.0.17 → patchman-4.0.18}/repos/tests/__init__.py +0 -0
  283. {patchman-4.0.17 → patchman-4.0.18}/repos/tests/test_api.py +0 -0
  284. {patchman-4.0.17 → patchman-4.0.18}/repos/tests/test_managers.py +0 -0
  285. {patchman-4.0.17 → patchman-4.0.18}/repos/tests/test_mirror_sync.py +0 -0
  286. {patchman-4.0.17 → patchman-4.0.18}/repos/tests/test_models.py +0 -0
  287. {patchman-4.0.17 → patchman-4.0.18}/repos/urls.py +0 -0
  288. {patchman-4.0.17 → patchman-4.0.18}/repos/utils.py +0 -0
  289. {patchman-4.0.17 → patchman-4.0.18}/requirements.txt +0 -0
  290. {patchman-4.0.17 → patchman-4.0.18}/sbin/patchman +0 -0
  291. {patchman-4.0.17 → patchman-4.0.18}/sbin/patchman-manage +0 -0
  292. {patchman-4.0.17 → patchman-4.0.18}/sbin/patchman-set-secret-key +0 -0
  293. {patchman-4.0.17 → patchman-4.0.18}/scripts/clear-django-logs.py +0 -0
  294. {patchman-4.0.17 → patchman-4.0.18}/scripts/create_graph.sh +0 -0
  295. {patchman-4.0.17 → patchman-4.0.18}/scripts/rpm-install.sh +0 -0
  296. {patchman-4.0.17 → patchman-4.0.18}/scripts/rpm-post-install.sh +0 -0
  297. {patchman-4.0.17 → patchman-4.0.18}/security/__init__.py +0 -0
  298. {patchman-4.0.17 → patchman-4.0.18}/security/admin.py +0 -0
  299. {patchman-4.0.17 → patchman-4.0.18}/security/apps.py +0 -0
  300. {patchman-4.0.17 → patchman-4.0.18}/security/managers.py +0 -0
  301. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0001_initial.py +0 -0
  302. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0002_alter_cve_options.py +0 -0
  303. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0003_alter_cve_description_alter_cwe_description.py +0 -0
  304. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0004_alter_cve_options.py +0 -0
  305. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0005_reference_cve_references.py +0 -0
  306. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0006_alter_cve_options_alter_cvss_unique_together.py +0 -0
  307. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0007_remove_cve_title.py +0 -0
  308. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0008_alter_cwe_options_alter_reference_options.py +0 -0
  309. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0009_alter_cvss_severity_alter_cvss_vector_string_and_more.py +0 -0
  310. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/0010_fix_cvss_vector_string_length.py +0 -0
  311. {patchman-4.0.17 → patchman-4.0.18}/security/migrations/__init__.py +0 -0
  312. {patchman-4.0.17 → patchman-4.0.18}/security/models.py +0 -0
  313. {patchman-4.0.17 → patchman-4.0.18}/security/serializers.py +0 -0
  314. {patchman-4.0.17 → patchman-4.0.18}/security/tables.py +0 -0
  315. {patchman-4.0.17 → patchman-4.0.18}/security/tasks.py +0 -0
  316. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/cve_detail.html +0 -0
  317. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/cve_list.html +0 -0
  318. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/cwe_detail.html +0 -0
  319. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/cwe_list.html +0 -0
  320. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/reference_list.html +0 -0
  321. {patchman-4.0.17 → patchman-4.0.18}/security/templates/security/security_landing.html +0 -0
  322. {patchman-4.0.17 → patchman-4.0.18}/security/tests/__init__.py +0 -0
  323. {patchman-4.0.17 → patchman-4.0.18}/security/tests/test_api.py +0 -0
  324. {patchman-4.0.17 → patchman-4.0.18}/security/tests/test_models.py +0 -0
  325. {patchman-4.0.17 → patchman-4.0.18}/security/urls.py +0 -0
  326. {patchman-4.0.17 → patchman-4.0.18}/security/utils.py +0 -0
  327. {patchman-4.0.17 → patchman-4.0.18}/security/views.py +0 -0
  328. {patchman-4.0.17 → patchman-4.0.18}/setup.cfg +0 -0
  329. {patchman-4.0.17 → patchman-4.0.18}/setup.py +0 -0
  330. {patchman-4.0.17 → patchman-4.0.18}/util/__init__.py +0 -0
  331. {patchman-4.0.17 → patchman-4.0.18}/util/apps.py +0 -0
  332. {patchman-4.0.17 → patchman-4.0.18}/util/context_processors.py +0 -0
  333. {patchman-4.0.17 → patchman-4.0.18}/util/filterspecs.py +0 -0
  334. {patchman-4.0.17 → patchman-4.0.18}/util/logging.py +0 -0
  335. {patchman-4.0.17 → patchman-4.0.18}/util/management/__init__.py +0 -0
  336. {patchman-4.0.17 → patchman-4.0.18}/util/management/commands/__init__.py +0 -0
  337. {patchman-4.0.17 → patchman-4.0.18}/util/management/commands/create_api_key.py +0 -0
  338. {patchman-4.0.17 → patchman-4.0.18}/util/management/commands/list_api_keys.py +0 -0
  339. {patchman-4.0.17 → patchman-4.0.18}/util/management/commands/revoke_api_key.py +0 -0
  340. {patchman-4.0.17 → patchman-4.0.18}/util/tables.py +0 -0
  341. {patchman-4.0.17 → patchman-4.0.18}/util/tasks.py +0 -0
  342. {patchman-4.0.17 → patchman-4.0.18}/util/templates/404.html +0 -0
  343. {patchman-4.0.17 → patchman-4.0.18}/util/templates/500.html +0 -0
  344. {patchman-4.0.17 → patchman-4.0.18}/util/templates/base.html +0 -0
  345. {patchman-4.0.17 → patchman-4.0.18}/util/templates/bulk_actions.html +0 -0
  346. {patchman-4.0.17 → patchman-4.0.18}/util/templates/dashboard.html +0 -0
  347. {patchman-4.0.17 → patchman-4.0.18}/util/templates/navbar.html +0 -0
  348. {patchman-4.0.17 → patchman-4.0.18}/util/templates/objectlist.html +0 -0
  349. {patchman-4.0.17 → patchman-4.0.18}/util/templates/registration/login.html +0 -0
  350. {patchman-4.0.17 → patchman-4.0.18}/util/templates/searchbar.html +0 -0
  351. {patchman-4.0.17 → patchman-4.0.18}/util/templates/table.html +0 -0
  352. {patchman-4.0.17 → patchman-4.0.18}/util/templatetags/__init__.py +0 -0
  353. {patchman-4.0.17 → patchman-4.0.18}/util/templatetags/common.py +0 -0
  354. {patchman-4.0.17 → patchman-4.0.18}/util/tests/__init__.py +0 -0
  355. {patchman-4.0.17 → patchman-4.0.18}/util/tests/test_commands.py +0 -0
  356. {patchman-4.0.17 → patchman-4.0.18}/util/tests/test_utils.py +0 -0
  357. {patchman-4.0.17 → patchman-4.0.18}/util/urls.py +0 -0
  358. {patchman-4.0.17 → patchman-4.0.18}/util/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchman
3
- Version: 4.0.17
3
+ Version: 4.0.18
4
4
  Summary: Django based patch status monitoring tool for linux systems
5
5
  Home-page: http://patchman.openbytes.ie/
6
6
  Author: Marcus Furlong
@@ -0,0 +1 @@
1
+ 4.0.18
@@ -204,10 +204,12 @@ class Host(models.Model):
204
204
  host_packages = self.packages.exclude(kernels_q).distinct()
205
205
  kernel_packages = self.packages.filter(kernels_q)
206
206
 
207
+ errata_ids = set()
208
+
207
209
  if self.host_repos_only:
208
- update_ids = self.find_host_repo_updates(host_packages, repo_packages)
210
+ update_ids = self.find_host_repo_updates(host_packages, repo_packages, errata_ids)
209
211
  else:
210
- update_ids = self.find_osrelease_repo_updates(host_packages, repo_packages)
212
+ update_ids = self.find_osrelease_repo_updates(host_packages, repo_packages, errata_ids)
211
213
 
212
214
  kernel_update_ids = self.find_kernel_updates(kernel_packages, repo_packages)
213
215
  for ku_id in kernel_update_ids:
@@ -217,7 +219,11 @@ class Host(models.Model):
217
219
  if update.id not in update_ids:
218
220
  self.updates.remove(update)
219
221
 
220
- def find_host_repo_updates(self, host_packages, repo_packages):
222
+ for erratum in self.errata.all():
223
+ if erratum.id not in errata_ids:
224
+ self.errata.remove(erratum)
225
+
226
+ def find_host_repo_updates(self, host_packages, repo_packages, errata_ids):
221
227
 
222
228
  update_ids = []
223
229
  hostrepos_q = Q(repo__mirror__enabled=True,
@@ -258,6 +264,7 @@ class Host(models.Model):
258
264
  if errata:
259
265
  for erratum in errata:
260
266
  self.errata.add(erratum)
267
+ errata_ids.add(erratum.id)
261
268
  if highest_package.compare_version(pu) == -1:
262
269
  if priority is not None:
263
270
  # proceed only if the package is from a repo with a
@@ -276,7 +283,7 @@ class Host(models.Model):
276
283
  update_ids.append(uid)
277
284
  return update_ids
278
285
 
279
- def find_osrelease_repo_updates(self, host_packages, repo_packages):
286
+ def find_osrelease_repo_updates(self, host_packages, repo_packages, errata_ids):
280
287
 
281
288
  update_ids = []
282
289
  for package in host_packages:
@@ -304,6 +311,7 @@ class Host(models.Model):
304
311
  if errata:
305
312
  for erratum in errata:
306
313
  self.errata.add(erratum)
314
+ errata_ids.add(erratum.id)
307
315
  if highest_package.compare_version(pu) == -1:
308
316
  highest_package = pu
309
317
 
@@ -4,6 +4,13 @@ import os
4
4
  import site
5
5
  import sys
6
6
 
7
+ # use pysqlite3 if available
8
+ try:
9
+ import pysqlite3 # noqa
10
+ sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
11
+ except ImportError:
12
+ pass
13
+
7
14
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
8
15
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchman
3
- Version: 4.0.17
3
+ Version: 4.0.18
4
4
  Summary: Django based patch status monitoring tool for linux systems
5
5
  Home-page: http://patchman.openbytes.ie/
6
6
  Author: Marcus Furlong
@@ -286,6 +286,7 @@ repos/tests/test_api.py
286
286
  repos/tests/test_managers.py
287
287
  repos/tests/test_mirror_sync.py
288
288
  repos/tests/test_models.py
289
+ repos/tests/test_views.py
289
290
  sbin/patchman
290
291
  sbin/patchman-manage
291
292
  sbin/patchman-set-secret-key
@@ -19,6 +19,7 @@ from django.test import TestCase, override_settings
19
19
  from packages.models import Package
20
20
  from reports.utils import (
21
21
  _get_package_type, _get_repo_type, parse_packages, parse_repos,
22
+ process_repo_text,
22
23
  )
23
24
  from repos.models import Repository
24
25
 
@@ -178,3 +179,61 @@ class GetRepoTypeTests(TestCase):
178
179
  """Test unknown repo type returns None."""
179
180
  self.assertIsNone(_get_repo_type(''))
180
181
  self.assertIsNone(_get_repo_type('invalid'))
182
+
183
+
184
+ @override_settings(
185
+ CELERY_TASK_ALWAYS_EAGER=True,
186
+ CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
187
+ )
188
+ class ProcessRepoTextTests(TestCase):
189
+ """Tests for process_repo_text() - handles malformed repo data gracefully."""
190
+
191
+ def setUp(self):
192
+ from arch.models import MachineArchitecture
193
+ self.arch, _ = MachineArchitecture.objects.get_or_create(name='x86_64')
194
+
195
+ def test_rpm_normal(self):
196
+ """Test normal RPM repo parsing."""
197
+ repo = ['rpm', 'Rocky BaseOS x86_64', 'baseos', '99',
198
+ 'https://dl.rockylinux.org/vault/rocky/9/BaseOS/x86_64/os/']
199
+ result, priority = process_repo_text(repo, 'x86_64')
200
+ self.assertIsNotNone(result)
201
+ self.assertEqual(priority, -99)
202
+
203
+ def test_rpm_url_as_priority(self):
204
+ """Test RPM repo where URL appears where priority should be (metalink merge bug)."""
205
+ repo = ['rpm', 'EPEL 9 x86_64', 'epel',
206
+ 'https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=x86_64']
207
+ result, priority = process_repo_text(repo, 'x86_64')
208
+ self.assertIsNone(result)
209
+ self.assertEqual(priority, 0)
210
+
211
+ def test_rpm_missing_priority(self):
212
+ """Test RPM repo with missing priority field skips gracefully."""
213
+ repo = ['rpm', 'EPEL x86_64', 'epel']
214
+ result, priority = process_repo_text(repo, 'x86_64')
215
+ self.assertIsNone(result)
216
+ self.assertEqual(priority, 0)
217
+
218
+ def test_deb_normal(self):
219
+ """Test normal Debian repo parsing."""
220
+ repo = ['deb', 'Ubuntu Main x86_64', '500',
221
+ 'http://archive.ubuntu.com/ubuntu']
222
+ result, priority = process_repo_text(repo, 'x86_64')
223
+ self.assertIsNotNone(result)
224
+ self.assertEqual(priority, 500)
225
+
226
+ def test_deb_url_as_priority(self):
227
+ """Test Debian repo where URL appears where priority should be."""
228
+ repo = ['deb', 'Ubuntu Main x86_64',
229
+ 'http://archive.ubuntu.com/ubuntu']
230
+ result, priority = process_repo_text(repo, 'x86_64')
231
+ self.assertIsNone(result)
232
+ self.assertEqual(priority, 0)
233
+
234
+ def test_unknown_type(self):
235
+ """Test unknown repo type returns None."""
236
+ repo = ['unknown', 'test', '0', 'http://example.com']
237
+ result, priority = process_repo_text(repo, 'x86_64')
238
+ self.assertIsNone(result)
239
+ self.assertEqual(priority, 0)
@@ -34,7 +34,7 @@ from packages.utils import (
34
34
  from patchman.signals import pbar_start, pbar_update
35
35
  from repos.models import Mirror, MirrorPackage, Repository
36
36
  from repos.utils import get_or_create_repo
37
- from util.logging import debug_message, info_message
37
+ from util.logging import debug_message, error_message, info_message
38
38
 
39
39
 
40
40
  def process_repos(report, host):
@@ -281,23 +281,27 @@ def process_repo_text(repo, arch):
281
281
  """
282
282
  r_id = None
283
283
 
284
- if repo[0] == 'deb':
285
- r_type = Repository.DEB
286
- r_priority = int(repo[2])
287
- elif repo[0] == 'rpm':
288
- r_type = Repository.RPM
289
- r_id = repo.pop(2)
290
- r_priority = int(repo[2]) * -1
291
- elif repo[0] == 'arch':
292
- r_type = Repository.ARCH
293
- r_id = repo[2]
294
- r_priority = 0
295
- elif repo[0] == 'gentoo':
296
- r_type = Repository.GENTOO
297
- r_id = repo.pop(2)
298
- r_priority = repo[2]
299
- arch = 'any'
300
- else:
284
+ try:
285
+ if repo[0] == 'deb':
286
+ r_type = Repository.DEB
287
+ r_priority = int(repo[2])
288
+ elif repo[0] == 'rpm':
289
+ r_type = Repository.RPM
290
+ r_id = repo.pop(2)
291
+ r_priority = int(repo[2]) * -1
292
+ elif repo[0] == 'arch':
293
+ r_type = Repository.ARCH
294
+ r_id = repo[2]
295
+ r_priority = 0
296
+ elif repo[0] == 'gentoo':
297
+ r_type = Repository.GENTOO
298
+ r_id = repo.pop(2)
299
+ r_priority = int(repo[2])
300
+ arch = 'any'
301
+ else:
302
+ return None, 0
303
+ except (ValueError, IndexError) as e:
304
+ error_message(text=f'Skipping malformed repo line: {repo} ({e})')
301
305
  return None, 0
302
306
 
303
307
  r_name = repo[1] if repo[1] else ''
@@ -0,0 +1,114 @@
1
+ from django.contrib.auth.models import User
2
+ from django.test import TestCase, override_settings
3
+ from django.urls import reverse
4
+
5
+ from arch.models import MachineArchitecture
6
+ from repos.models import Mirror, Repository
7
+
8
+
9
+ @override_settings(
10
+ CELERY_TASK_ALWAYS_EAGER=True,
11
+ CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
12
+ )
13
+ class RepoBulkActionTests(TestCase):
14
+ """Tests for repo_bulk_action view."""
15
+
16
+ def setUp(self):
17
+ self.user = User.objects.create_user(
18
+ username='testuser', password='testpass'
19
+ )
20
+ self.client.login(username='testuser', password='testpass')
21
+ self.arch = MachineArchitecture.objects.create(name='x86_64')
22
+ self.repos = []
23
+ for i in range(3):
24
+ self.repos.append(Repository.objects.create(
25
+ name=f'repo-{i}',
26
+ arch=self.arch,
27
+ repotype='D',
28
+ enabled=True,
29
+ ))
30
+
31
+ def test_bulk_delete_selected(self):
32
+ """Test bulk delete with individually selected repos."""
33
+ ids = [str(r.id) for r in self.repos[:2]]
34
+ resp = self.client.post(reverse('repos:repo_bulk_action'), {
35
+ 'action': 'delete',
36
+ 'selected_ids': ids,
37
+ })
38
+ self.assertEqual(resp.status_code, 302)
39
+ self.assertEqual(Repository.objects.count(), 1)
40
+
41
+ def test_bulk_delete_select_all_filtered(self):
42
+ """Test bulk delete with select-all-filtered (uses .distinct())."""
43
+ resp = self.client.post(reverse('repos:repo_bulk_action'), {
44
+ 'action': 'delete',
45
+ 'select_all_filtered': '1',
46
+ 'filter_params': '',
47
+ })
48
+ self.assertEqual(resp.status_code, 302)
49
+ self.assertEqual(Repository.objects.count(), 0)
50
+
51
+ def test_bulk_enable_disable(self):
52
+ """Test bulk enable/disable actions."""
53
+ ids = [str(r.id) for r in self.repos]
54
+ self.client.post(reverse('repos:repo_bulk_action'), {
55
+ 'action': 'disable',
56
+ 'selected_ids': ids,
57
+ })
58
+ self.assertTrue(all(
59
+ not r.enabled for r in Repository.objects.all()
60
+ ))
61
+ self.client.post(reverse('repos:repo_bulk_action'), {
62
+ 'action': 'enable',
63
+ 'selected_ids': ids,
64
+ })
65
+ self.assertTrue(all(
66
+ r.enabled for r in Repository.objects.all()
67
+ ))
68
+
69
+
70
+ @override_settings(
71
+ CELERY_TASK_ALWAYS_EAGER=True,
72
+ CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
73
+ )
74
+ class MirrorBulkActionTests(TestCase):
75
+ """Tests for mirror_bulk_action view."""
76
+
77
+ def setUp(self):
78
+ self.user = User.objects.create_user(
79
+ username='testuser', password='testpass'
80
+ )
81
+ self.client.login(username='testuser', password='testpass')
82
+ self.arch = MachineArchitecture.objects.create(name='x86_64')
83
+ self.repo = Repository.objects.create(
84
+ name='repo-0',
85
+ arch=self.arch,
86
+ repotype='D',
87
+ enabled=True,
88
+ )
89
+ self.mirrors = []
90
+ for i in range(3):
91
+ self.mirrors.append(Mirror.objects.create(
92
+ repo=self.repo,
93
+ url=f'http://mirror{i}.example.com/repo',
94
+ ))
95
+
96
+ def test_bulk_delete_select_all_filtered(self):
97
+ """Test bulk delete mirrors with select-all-filtered (uses .distinct())."""
98
+ resp = self.client.post(reverse('repos:mirror_bulk_action'), {
99
+ 'action': 'delete',
100
+ 'select_all_filtered': '1',
101
+ 'filter_params': '',
102
+ })
103
+ self.assertEqual(resp.status_code, 302)
104
+ self.assertEqual(Mirror.objects.count(), 0)
105
+
106
+ def test_bulk_delete_selected(self):
107
+ """Test bulk delete with individually selected mirrors."""
108
+ ids = [str(m.id) for m in self.mirrors[:2]]
109
+ resp = self.client.post(reverse('repos:mirror_bulk_action'), {
110
+ 'action': 'delete',
111
+ 'selected_ids': ids,
112
+ })
113
+ self.assertEqual(resp.status_code, 302)
114
+ self.assertEqual(Mirror.objects.count(), 1)
@@ -491,7 +491,7 @@ def repo_bulk_action(request):
491
491
  refresh_repo.delay(repo.id)
492
492
  messages.success(request, f'Queued {count} {name} for refresh')
493
493
  elif action == 'delete':
494
- repos.delete()
494
+ Repository.objects.filter(pk__in=repos.values_list('pk', flat=True)).delete()
495
495
  messages.success(request, f'Deleted {count} {name}')
496
496
  else:
497
497
  messages.warning(request, 'Invalid action')
@@ -574,7 +574,7 @@ def mirror_bulk_action(request):
574
574
  mirrors.update(refresh=False)
575
575
  messages.success(request, f'Disabled refresh for {count} {name}')
576
576
  elif action == 'delete':
577
- mirrors.delete()
577
+ Mirror.objects.filter(pk__in=mirrors.values_list('pk', flat=True)).delete()
578
578
  messages.success(request, f'Deleted {count} {name}')
579
579
  else:
580
580
  messages.warning(request, 'Invalid action')
@@ -1 +0,0 @@
1
- 4.0.17
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes