patchman 4.0.21__tar.gz → 4.0.24__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 (371) hide show
  1. {patchman-4.0.21 → patchman-4.0.24}/PKG-INFO +2 -2
  2. patchman-4.0.24/VERSION.txt +1 -0
  3. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/repos/yum.py +21 -3
  4. patchman-4.0.24/errata/tests/test_yum.py +52 -0
  5. {patchman-4.0.21 → patchman-4.0.24}/errata/utils.py +2 -0
  6. patchman-4.0.24/hosts/migrations/0014_drop_legacy_tagging.py +34 -0
  7. {patchman-4.0.21 → patchman-4.0.24}/hosts/models.py +27 -0
  8. {patchman-4.0.21 → patchman-4.0.24}/hosts/tests/test_find_updates.py +90 -0
  9. patchman-4.0.24/hosts/tests/test_migrations.py +99 -0
  10. {patchman-4.0.21 → patchman-4.0.24}/hosts/tests/test_models.py +39 -0
  11. patchman-4.0.24/hosts/tests/test_utils.py +91 -0
  12. {patchman-4.0.21 → patchman-4.0.24}/hosts/utils.py +35 -1
  13. {patchman-4.0.21 → patchman-4.0.24}/packages/models.py +1 -1
  14. {patchman-4.0.21 → patchman-4.0.24}/patchman.egg-info/PKG-INFO +2 -2
  15. {patchman-4.0.21 → patchman-4.0.24}/patchman.egg-info/SOURCES.txt +5 -0
  16. {patchman-4.0.21 → patchman-4.0.24}/patchman.egg-info/requires.txt +1 -1
  17. patchman-4.0.24/reports/migrations/0006_alter_report_options.py +17 -0
  18. {patchman-4.0.21 → patchman-4.0.24}/reports/models.py +3 -0
  19. {patchman-4.0.21 → patchman-4.0.24}/reports/serializers.py +3 -1
  20. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_serializers.py +11 -0
  21. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_utils.py +46 -1
  22. {patchman-4.0.21 → patchman-4.0.24}/reports/utils.py +74 -26
  23. {patchman-4.0.21 → patchman-4.0.24}/requirements.txt +1 -1
  24. {patchman-4.0.21 → patchman-4.0.24}/sbin/patchman +1 -1
  25. {patchman-4.0.21 → patchman-4.0.24}/security/models.py +24 -22
  26. {patchman-4.0.21 → patchman-4.0.24}/security/tests/test_models.py +30 -0
  27. {patchman-4.0.21 → patchman-4.0.24}/util/__init__.py +15 -12
  28. {patchman-4.0.21 → patchman-4.0.24}/util/tests/test_utils.py +43 -1
  29. patchman-4.0.21/VERSION.txt +0 -1
  30. {patchman-4.0.21 → patchman-4.0.24}/AUTHORS +0 -0
  31. {patchman-4.0.21 → patchman-4.0.24}/COPYING +0 -0
  32. {patchman-4.0.21 → patchman-4.0.24}/INSTALL.md +0 -0
  33. {patchman-4.0.21 → patchman-4.0.24}/MANIFEST.in +0 -0
  34. {patchman-4.0.21 → patchman-4.0.24}/README.md +0 -0
  35. {patchman-4.0.21 → patchman-4.0.24}/arch/__init__.py +0 -0
  36. {patchman-4.0.21 → patchman-4.0.24}/arch/admin.py +0 -0
  37. {patchman-4.0.21 → patchman-4.0.24}/arch/apps.py +0 -0
  38. {patchman-4.0.21 → patchman-4.0.24}/arch/migrations/0001_initial.py +0 -0
  39. {patchman-4.0.21 → patchman-4.0.24}/arch/migrations/0002_alter_machinearchitecture_options_and_more.py +0 -0
  40. {patchman-4.0.21 → patchman-4.0.24}/arch/migrations/__init__.py +0 -0
  41. {patchman-4.0.21 → patchman-4.0.24}/arch/models.py +0 -0
  42. {patchman-4.0.21 → patchman-4.0.24}/arch/serializers.py +0 -0
  43. {patchman-4.0.21 → patchman-4.0.24}/arch/tests/__init__.py +0 -0
  44. {patchman-4.0.21 → patchman-4.0.24}/arch/tests/test_api.py +0 -0
  45. {patchman-4.0.21 → patchman-4.0.24}/arch/tests/test_models.py +0 -0
  46. {patchman-4.0.21 → patchman-4.0.24}/arch/utils.py +0 -0
  47. {patchman-4.0.21 → patchman-4.0.24}/arch/views.py +0 -0
  48. {patchman-4.0.21 → patchman-4.0.24}/domains/__init__.py +0 -0
  49. {patchman-4.0.21 → patchman-4.0.24}/domains/admin.py +0 -0
  50. {patchman-4.0.21 → patchman-4.0.24}/domains/apps.py +0 -0
  51. {patchman-4.0.21 → patchman-4.0.24}/domains/migrations/0001_initial.py +0 -0
  52. {patchman-4.0.21 → patchman-4.0.24}/domains/migrations/0002_alter_domain_options.py +0 -0
  53. {patchman-4.0.21 → patchman-4.0.24}/domains/migrations/__init__.py +0 -0
  54. {patchman-4.0.21 → patchman-4.0.24}/domains/models.py +0 -0
  55. {patchman-4.0.21 → patchman-4.0.24}/domains/serializers.py +0 -0
  56. {patchman-4.0.21 → patchman-4.0.24}/domains/tests/__init__.py +0 -0
  57. {patchman-4.0.21 → patchman-4.0.24}/domains/tests/test_api.py +0 -0
  58. {patchman-4.0.21 → patchman-4.0.24}/domains/tests/test_models.py +0 -0
  59. {patchman-4.0.21 → patchman-4.0.24}/domains/views.py +0 -0
  60. {patchman-4.0.21 → patchman-4.0.24}/errata/__init__.py +0 -0
  61. {patchman-4.0.21 → patchman-4.0.24}/errata/admin.py +0 -0
  62. {patchman-4.0.21 → patchman-4.0.24}/errata/apps.py +0 -0
  63. {patchman-4.0.21 → patchman-4.0.24}/errata/managers.py +0 -0
  64. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0001_initial.py +0 -0
  65. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0002_alter_erratumreference_unique_together.py +0 -0
  66. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0003_delete_erratumreference_alter_erratum_references.py +0 -0
  67. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0004_rename_packages_erratum_fixed_packages.py +0 -0
  68. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0005_erratum_affected_packages_and_more.py +0 -0
  69. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0006_alter_erratum_options.py +0 -0
  70. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0007_alter_erratum_fixed_packages.py +0 -0
  71. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0008_add_cached_count_fields.py +0 -0
  72. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0009_backfill_cached_counts.py +0 -0
  73. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/0010_synopsis_textfield.py +0 -0
  74. {patchman-4.0.21 → patchman-4.0.24}/errata/migrations/__init__.py +0 -0
  75. {patchman-4.0.21 → patchman-4.0.24}/errata/models.py +0 -0
  76. {patchman-4.0.21 → patchman-4.0.24}/errata/serializers.py +0 -0
  77. {patchman-4.0.21 → patchman-4.0.24}/errata/signals.py +0 -0
  78. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/__init__.py +0 -0
  79. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/__init__.py +0 -0
  80. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/alma.py +0 -0
  81. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/arch.py +0 -0
  82. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/centos.py +0 -0
  83. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/debian.py +0 -0
  84. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/rocky.py +0 -0
  85. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/distros/ubuntu.py +0 -0
  86. {patchman-4.0.21 → patchman-4.0.24}/errata/sources/repos/__init__.py +0 -0
  87. {patchman-4.0.21 → patchman-4.0.24}/errata/tables.py +0 -0
  88. {patchman-4.0.21 → patchman-4.0.24}/errata/tasks.py +0 -0
  89. {patchman-4.0.21 → patchman-4.0.24}/errata/templates/errata/erratum_detail.html +0 -0
  90. {patchman-4.0.21 → patchman-4.0.24}/errata/templates/errata/erratum_list.html +0 -0
  91. {patchman-4.0.21 → patchman-4.0.24}/errata/tests/__init__.py +0 -0
  92. {patchman-4.0.21 → patchman-4.0.24}/errata/tests/test_api.py +0 -0
  93. {patchman-4.0.21 → patchman-4.0.24}/errata/tests/test_integration.py +0 -0
  94. {patchman-4.0.21 → patchman-4.0.24}/errata/tests/test_models.py +0 -0
  95. {patchman-4.0.21 → patchman-4.0.24}/errata/urls.py +0 -0
  96. {patchman-4.0.21 → patchman-4.0.24}/errata/views.py +0 -0
  97. {patchman-4.0.21 → patchman-4.0.24}/etc/patchman/apache.conf.example +0 -0
  98. {patchman-4.0.21 → patchman-4.0.24}/etc/patchman/celery.conf +0 -0
  99. {patchman-4.0.21 → patchman-4.0.24}/etc/patchman/local_settings.py +0 -0
  100. {patchman-4.0.21 → patchman-4.0.24}/etc/systemd/system/patchman-celery-beat.service +0 -0
  101. {patchman-4.0.21 → patchman-4.0.24}/etc/systemd/system/patchman-celery-worker@.service +0 -0
  102. {patchman-4.0.21 → patchman-4.0.24}/hosts/__init__.py +0 -0
  103. {patchman-4.0.21 → patchman-4.0.24}/hosts/admin.py +0 -0
  104. {patchman-4.0.21 → patchman-4.0.24}/hosts/apps.py +0 -0
  105. {patchman-4.0.21 → patchman-4.0.24}/hosts/forms.py +0 -0
  106. {patchman-4.0.21 → patchman-4.0.24}/hosts/managers.py +0 -0
  107. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0001_initial.py +0 -0
  108. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0002_initial.py +0 -0
  109. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0003_host_modules.py +0 -0
  110. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0004_remove_host_tags_host_tags.py +0 -0
  111. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0005_rename_os_host_osvariant.py +0 -0
  112. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0006_migrate_to_tz_aware.py +0 -0
  113. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0007_alter_host_tags.py +0 -0
  114. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0008_alter_host_options.py +0 -0
  115. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0009_host_errata.py +0 -0
  116. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0010_alter_hostrepo_options.py +0 -0
  117. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0011_host_bug_updates_count_host_errata_count_and_more.py +0 -0
  118. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0012_backfill_cached_counts.py +0 -0
  119. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/0013_alter_hostrepo_unique_together_and_more.py +0 -0
  120. {patchman-4.0.21 → patchman-4.0.24}/hosts/migrations/__init__.py +0 -0
  121. {patchman-4.0.21 → patchman-4.0.24}/hosts/serializers.py +0 -0
  122. {patchman-4.0.21 → patchman-4.0.24}/hosts/signals.py +0 -0
  123. {patchman-4.0.21 → patchman-4.0.24}/hosts/tables.py +0 -0
  124. {patchman-4.0.21 → patchman-4.0.24}/hosts/tasks.py +0 -0
  125. {patchman-4.0.21 → patchman-4.0.24}/hosts/templates/hosts/host_delete.html +0 -0
  126. {patchman-4.0.21 → patchman-4.0.24}/hosts/templates/hosts/host_detail.html +0 -0
  127. {patchman-4.0.21 → patchman-4.0.24}/hosts/templates/hosts/host_edit.html +0 -0
  128. {patchman-4.0.21 → patchman-4.0.24}/hosts/templates/hosts/host_list.html +0 -0
  129. {patchman-4.0.21 → patchman-4.0.24}/hosts/templatetags/__init__.py +0 -0
  130. {patchman-4.0.21 → patchman-4.0.24}/hosts/templatetags/report_alert.py +0 -0
  131. {patchman-4.0.21 → patchman-4.0.24}/hosts/tests/__init__.py +0 -0
  132. {patchman-4.0.21 → patchman-4.0.24}/hosts/tests/test_api.py +0 -0
  133. {patchman-4.0.21 → patchman-4.0.24}/hosts/tests/test_managers.py +0 -0
  134. {patchman-4.0.21 → patchman-4.0.24}/hosts/urls.py +0 -0
  135. {patchman-4.0.21 → patchman-4.0.24}/hosts/views.py +0 -0
  136. {patchman-4.0.21 → patchman-4.0.24}/modules/__init__.py +0 -0
  137. {patchman-4.0.21 → patchman-4.0.24}/modules/admin.py +0 -0
  138. {patchman-4.0.21 → patchman-4.0.24}/modules/apps.py +0 -0
  139. {patchman-4.0.21 → patchman-4.0.24}/modules/managers.py +0 -0
  140. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0001_initial.py +0 -0
  141. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0002_auto_20240204_2214.py +0 -0
  142. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0003_alter_module_options.py +0 -0
  143. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0004_alter_module_options.py +0 -0
  144. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0005_alter_module_unique_together.py +0 -0
  145. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0006_alter_module_context_alter_module_name_and_more.py +0 -0
  146. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/0007_alter_module_unique_together_module_unique_module.py +0 -0
  147. {patchman-4.0.21 → patchman-4.0.24}/modules/migrations/__init__.py +0 -0
  148. {patchman-4.0.21 → patchman-4.0.24}/modules/models.py +0 -0
  149. {patchman-4.0.21 → patchman-4.0.24}/modules/serializers.py +0 -0
  150. {patchman-4.0.21 → patchman-4.0.24}/modules/tables.py +0 -0
  151. {patchman-4.0.21 → patchman-4.0.24}/modules/templates/modules/module_detail.html +0 -0
  152. {patchman-4.0.21 → patchman-4.0.24}/modules/templates/modules/module_list.html +0 -0
  153. {patchman-4.0.21 → patchman-4.0.24}/modules/urls.py +0 -0
  154. {patchman-4.0.21 → patchman-4.0.24}/modules/utils.py +0 -0
  155. {patchman-4.0.21 → patchman-4.0.24}/modules/views.py +0 -0
  156. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/__init__.py +0 -0
  157. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/admin.py +0 -0
  158. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/apps.py +0 -0
  159. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/fixtures/os.json +0 -0
  160. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/fixtures/osgroup.json +0 -0
  161. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/forms.py +0 -0
  162. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/managers.py +0 -0
  163. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0001_initial.py +0 -0
  164. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0002_initial.py +0 -0
  165. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0003_os_arch.py +0 -0
  166. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0003_osgroup_codename.py +0 -0
  167. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0004_alter_osgroup_unique_together.py +0 -0
  168. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0005_rename_osgroup_osrelease_rename_os_osvariant_and_more.py +0 -0
  169. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0006_osrelease_cpe_name_osvariant_codename.py +0 -0
  170. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0007_alter_osrelease_unique_together.py +0 -0
  171. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0008_alter_osrelease_options_alter_osvariant_options.py +0 -0
  172. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0009_osvariant_hosts_count.py +0 -0
  173. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0010_backfill_osvariant_counts.py +0 -0
  174. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0011_alter_osrelease_codename_alter_osrelease_cpe_name_and_more.py +0 -0
  175. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/0012_alter_osrelease_unique_together_and_more.py +0 -0
  176. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/migrations/__init__.py +0 -0
  177. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/models.py +0 -0
  178. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/serializers.py +0 -0
  179. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/signals.py +0 -0
  180. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/tables.py +0 -0
  181. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/os_landing.html +0 -0
  182. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osrelease_delete.html +0 -0
  183. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osrelease_detail.html +0 -0
  184. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osrelease_list.html +0 -0
  185. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osvariant_delete.html +0 -0
  186. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osvariant_delete_multiple.html +0 -0
  187. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osvariant_detail.html +0 -0
  188. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/templates/operatingsystems/osvariant_list.html +0 -0
  189. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/tests/__init__.py +0 -0
  190. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/tests/test_api.py +0 -0
  191. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/tests/test_models.py +0 -0
  192. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/urls.py +0 -0
  193. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/utils.py +0 -0
  194. {patchman-4.0.21 → patchman-4.0.24}/operatingsystems/views.py +0 -0
  195. {patchman-4.0.21 → patchman-4.0.24}/packages/__init__.py +0 -0
  196. {patchman-4.0.21 → patchman-4.0.24}/packages/admin.py +0 -0
  197. {patchman-4.0.21 → patchman-4.0.24}/packages/apps.py +0 -0
  198. {patchman-4.0.21 → patchman-4.0.24}/packages/managers.py +0 -0
  199. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0001_initial.py +0 -0
  200. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0002_auto_20250207_1319.py +0 -0
  201. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0002_delete_erratum_delete_erratumreference.py +0 -0
  202. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0003_auto_20250207_1746.py +0 -0
  203. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0004_alter_package_options_alter_packagecategory_options_and_more.py +0 -0
  204. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0005_alter_package_packagetype.py +0 -0
  205. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0006_alter_packageupdate_options.py +0 -0
  206. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0007_alter_package_epoch_alter_package_release_and_more.py +0 -0
  207. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/0008_alter_package_unique_together_and_more.py +0 -0
  208. {patchman-4.0.21 → patchman-4.0.24}/packages/migrations/__init__.py +0 -0
  209. {patchman-4.0.21 → patchman-4.0.24}/packages/serializers.py +0 -0
  210. {patchman-4.0.21 → patchman-4.0.24}/packages/tables.py +0 -0
  211. {patchman-4.0.21 → patchman-4.0.24}/packages/templates/packages/package_detail.html +0 -0
  212. {patchman-4.0.21 → patchman-4.0.24}/packages/templates/packages/package_list.html +0 -0
  213. {patchman-4.0.21 → patchman-4.0.24}/packages/templates/packages/package_name_detail.html +0 -0
  214. {patchman-4.0.21 → patchman-4.0.24}/packages/templates/packages/package_name_list.html +0 -0
  215. {patchman-4.0.21 → patchman-4.0.24}/packages/templates/packages/package_update_list.html +0 -0
  216. {patchman-4.0.21 → patchman-4.0.24}/packages/tests/__init__.py +0 -0
  217. {patchman-4.0.21 → patchman-4.0.24}/packages/tests/test_api.py +0 -0
  218. {patchman-4.0.21 → patchman-4.0.24}/packages/tests/test_models.py +0 -0
  219. {patchman-4.0.21 → patchman-4.0.24}/packages/tests/test_version_compare.py +0 -0
  220. {patchman-4.0.21 → patchman-4.0.24}/packages/tests/test_views.py +0 -0
  221. {patchman-4.0.21 → patchman-4.0.24}/packages/urls.py +0 -0
  222. {patchman-4.0.21 → patchman-4.0.24}/packages/utils.py +0 -0
  223. {patchman-4.0.21 → patchman-4.0.24}/packages/views.py +0 -0
  224. {patchman-4.0.21 → patchman-4.0.24}/patchman/__init__.py +0 -0
  225. {patchman-4.0.21 → patchman-4.0.24}/patchman/celery.py +0 -0
  226. {patchman-4.0.21 → patchman-4.0.24}/patchman/receivers.py +0 -0
  227. {patchman-4.0.21 → patchman-4.0.24}/patchman/settings.py +0 -0
  228. {patchman-4.0.21 → patchman-4.0.24}/patchman/signals.py +0 -0
  229. {patchman-4.0.21 → patchman-4.0.24}/patchman/sqlite3/base.py +0 -0
  230. {patchman-4.0.21 → patchman-4.0.24}/patchman/static/css/base.css +0 -0
  231. {patchman-4.0.21 → patchman-4.0.24}/patchman/static/js/expandable-text.js +0 -0
  232. {patchman-4.0.21 → patchman-4.0.24}/patchman/static/js/sidebar.js +0 -0
  233. {patchman-4.0.21 → patchman-4.0.24}/patchman/urls.py +0 -0
  234. {patchman-4.0.21 → patchman-4.0.24}/patchman/wsgi.py +0 -0
  235. {patchman-4.0.21 → patchman-4.0.24}/patchman.egg-info/dependency_links.txt +0 -0
  236. {patchman-4.0.21 → patchman-4.0.24}/patchman.egg-info/top_level.txt +0 -0
  237. {patchman-4.0.21 → patchman-4.0.24}/reports/__init__.py +0 -0
  238. {patchman-4.0.21 → patchman-4.0.24}/reports/admin.py +0 -0
  239. {patchman-4.0.21 → patchman-4.0.24}/reports/apps.py +0 -0
  240. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/0001_initial.py +0 -0
  241. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/0002_report_modules.py +0 -0
  242. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/0003_remove_report_accessed.py +0 -0
  243. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/0004_migrate_to_tz_aware.py +0 -0
  244. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/0005_alter_report_options.py +0 -0
  245. {patchman-4.0.21 → patchman-4.0.24}/reports/migrations/__init__.py +0 -0
  246. {patchman-4.0.21 → patchman-4.0.24}/reports/tables.py +0 -0
  247. {patchman-4.0.21 → patchman-4.0.24}/reports/tasks.py +0 -0
  248. {patchman-4.0.21 → patchman-4.0.24}/reports/templates/reports/report.txt +0 -0
  249. {patchman-4.0.21 → patchman-4.0.24}/reports/templates/reports/report_delete.html +0 -0
  250. {patchman-4.0.21 → patchman-4.0.24}/reports/templates/reports/report_detail.html +0 -0
  251. {patchman-4.0.21 → patchman-4.0.24}/reports/templates/reports/report_list.html +0 -0
  252. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/__init__.py +0 -0
  253. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_api.py +0 -0
  254. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_edge_cases.py +0 -0
  255. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_integration.py +0 -0
  256. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_models.py +0 -0
  257. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_parsing.py +0 -0
  258. {patchman-4.0.21 → patchman-4.0.24}/reports/tests/test_tasks.py +0 -0
  259. {patchman-4.0.21 → patchman-4.0.24}/reports/urls.py +0 -0
  260. {patchman-4.0.21 → patchman-4.0.24}/reports/views.py +0 -0
  261. {patchman-4.0.21 → patchman-4.0.24}/repos/__init__.py +0 -0
  262. {patchman-4.0.21 → patchman-4.0.24}/repos/admin.py +0 -0
  263. {patchman-4.0.21 → patchman-4.0.24}/repos/apps.py +0 -0
  264. {patchman-4.0.21 → patchman-4.0.24}/repos/forms.py +0 -0
  265. {patchman-4.0.21 → patchman-4.0.24}/repos/managers.py +0 -0
  266. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0001_initial.py +0 -0
  267. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0002_alter_repository_repotype.py +0 -0
  268. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0003_migrate_to_tz_aware.py +0 -0
  269. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0004_rename_file_checksum_mirror_package_checksum.py +0 -0
  270. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0005_rename_package_checksum_mirror_packages_checksum.py +0 -0
  271. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0006_mirror_errata_checksum_mirror_modules_checksum.py +0 -0
  272. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0007_alter_mirror_options_alter_mirrorpackage_options_and_more.py +0 -0
  273. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0008_mirror_packages_count.py +0 -0
  274. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/0009_backfill_mirror_counts.py +0 -0
  275. {patchman-4.0.21 → patchman-4.0.24}/repos/migrations/__init__.py +0 -0
  276. {patchman-4.0.21 → patchman-4.0.24}/repos/models.py +0 -0
  277. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/__init__.py +0 -0
  278. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/arch.py +0 -0
  279. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/deb.py +0 -0
  280. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/gentoo.py +0 -0
  281. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/rpm.py +0 -0
  282. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/yast.py +0 -0
  283. {patchman-4.0.21 → patchman-4.0.24}/repos/repo_types/yum.py +0 -0
  284. {patchman-4.0.21 → patchman-4.0.24}/repos/serializers.py +0 -0
  285. {patchman-4.0.21 → patchman-4.0.24}/repos/signals.py +0 -0
  286. {patchman-4.0.21 → patchman-4.0.24}/repos/tables.py +0 -0
  287. {patchman-4.0.21 → patchman-4.0.24}/repos/tasks.py +0 -0
  288. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/mirror_delete.html +0 -0
  289. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/mirror_detail.html +0 -0
  290. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/mirror_edit.html +0 -0
  291. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/mirror_list.html +0 -0
  292. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/mirror_with_repo_list.html +0 -0
  293. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/repo_delete.html +0 -0
  294. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/repo_detail.html +0 -0
  295. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/repo_edit.html +0 -0
  296. {patchman-4.0.21 → patchman-4.0.24}/repos/templates/repos/repo_list.html +0 -0
  297. {patchman-4.0.21 → patchman-4.0.24}/repos/templatetags/__init__.py +0 -0
  298. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/__init__.py +0 -0
  299. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/test_api.py +0 -0
  300. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/test_managers.py +0 -0
  301. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/test_mirror_sync.py +0 -0
  302. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/test_models.py +0 -0
  303. {patchman-4.0.21 → patchman-4.0.24}/repos/tests/test_views.py +0 -0
  304. {patchman-4.0.21 → patchman-4.0.24}/repos/urls.py +0 -0
  305. {patchman-4.0.21 → patchman-4.0.24}/repos/utils.py +0 -0
  306. {patchman-4.0.21 → patchman-4.0.24}/repos/views.py +0 -0
  307. {patchman-4.0.21 → patchman-4.0.24}/sbin/patchman-manage +0 -0
  308. {patchman-4.0.21 → patchman-4.0.24}/sbin/patchman-set-secret-key +0 -0
  309. {patchman-4.0.21 → patchman-4.0.24}/scripts/clear-django-logs.py +0 -0
  310. {patchman-4.0.21 → patchman-4.0.24}/scripts/create_graph.sh +0 -0
  311. {patchman-4.0.21 → patchman-4.0.24}/scripts/rpm-install.sh +0 -0
  312. {patchman-4.0.21 → patchman-4.0.24}/scripts/rpm-post-install.sh +0 -0
  313. {patchman-4.0.21 → patchman-4.0.24}/security/__init__.py +0 -0
  314. {patchman-4.0.21 → patchman-4.0.24}/security/admin.py +0 -0
  315. {patchman-4.0.21 → patchman-4.0.24}/security/apps.py +0 -0
  316. {patchman-4.0.21 → patchman-4.0.24}/security/managers.py +0 -0
  317. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0001_initial.py +0 -0
  318. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0002_alter_cve_options.py +0 -0
  319. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0003_alter_cve_description_alter_cwe_description.py +0 -0
  320. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0004_alter_cve_options.py +0 -0
  321. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0005_reference_cve_references.py +0 -0
  322. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0006_alter_cve_options_alter_cvss_unique_together.py +0 -0
  323. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0007_remove_cve_title.py +0 -0
  324. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0008_alter_cwe_options_alter_reference_options.py +0 -0
  325. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0009_alter_cvss_severity_alter_cvss_vector_string_and_more.py +0 -0
  326. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0010_fix_cvss_vector_string_length.py +0 -0
  327. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/0011_alter_cvss_unique_together_and_more.py +0 -0
  328. {patchman-4.0.21 → patchman-4.0.24}/security/migrations/__init__.py +0 -0
  329. {patchman-4.0.21 → patchman-4.0.24}/security/serializers.py +0 -0
  330. {patchman-4.0.21 → patchman-4.0.24}/security/tables.py +0 -0
  331. {patchman-4.0.21 → patchman-4.0.24}/security/tasks.py +0 -0
  332. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/cve_detail.html +0 -0
  333. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/cve_list.html +0 -0
  334. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/cwe_detail.html +0 -0
  335. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/cwe_list.html +0 -0
  336. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/reference_list.html +0 -0
  337. {patchman-4.0.21 → patchman-4.0.24}/security/templates/security/security_landing.html +0 -0
  338. {patchman-4.0.21 → patchman-4.0.24}/security/tests/__init__.py +0 -0
  339. {patchman-4.0.21 → patchman-4.0.24}/security/tests/test_api.py +0 -0
  340. {patchman-4.0.21 → patchman-4.0.24}/security/urls.py +0 -0
  341. {patchman-4.0.21 → patchman-4.0.24}/security/utils.py +0 -0
  342. {patchman-4.0.21 → patchman-4.0.24}/security/views.py +0 -0
  343. {patchman-4.0.21 → patchman-4.0.24}/setup.cfg +0 -0
  344. {patchman-4.0.21 → patchman-4.0.24}/setup.py +0 -0
  345. {patchman-4.0.21 → patchman-4.0.24}/util/apps.py +0 -0
  346. {patchman-4.0.21 → patchman-4.0.24}/util/context_processors.py +0 -0
  347. {patchman-4.0.21 → patchman-4.0.24}/util/filterspecs.py +0 -0
  348. {patchman-4.0.21 → patchman-4.0.24}/util/logging.py +0 -0
  349. {patchman-4.0.21 → patchman-4.0.24}/util/management/__init__.py +0 -0
  350. {patchman-4.0.21 → patchman-4.0.24}/util/management/commands/__init__.py +0 -0
  351. {patchman-4.0.21 → patchman-4.0.24}/util/management/commands/create_api_key.py +0 -0
  352. {patchman-4.0.21 → patchman-4.0.24}/util/management/commands/list_api_keys.py +0 -0
  353. {patchman-4.0.21 → patchman-4.0.24}/util/management/commands/revoke_api_key.py +0 -0
  354. {patchman-4.0.21 → patchman-4.0.24}/util/tables.py +0 -0
  355. {patchman-4.0.21 → patchman-4.0.24}/util/tasks.py +0 -0
  356. {patchman-4.0.21 → patchman-4.0.24}/util/templates/404.html +0 -0
  357. {patchman-4.0.21 → patchman-4.0.24}/util/templates/500.html +0 -0
  358. {patchman-4.0.21 → patchman-4.0.24}/util/templates/base.html +0 -0
  359. {patchman-4.0.21 → patchman-4.0.24}/util/templates/bulk_actions.html +0 -0
  360. {patchman-4.0.21 → patchman-4.0.24}/util/templates/dashboard.html +0 -0
  361. {patchman-4.0.21 → patchman-4.0.24}/util/templates/navbar.html +0 -0
  362. {patchman-4.0.21 → patchman-4.0.24}/util/templates/objectlist.html +0 -0
  363. {patchman-4.0.21 → patchman-4.0.24}/util/templates/registration/login.html +0 -0
  364. {patchman-4.0.21 → patchman-4.0.24}/util/templates/searchbar.html +0 -0
  365. {patchman-4.0.21 → patchman-4.0.24}/util/templates/table.html +0 -0
  366. {patchman-4.0.21 → patchman-4.0.24}/util/templatetags/__init__.py +0 -0
  367. {patchman-4.0.21 → patchman-4.0.24}/util/templatetags/common.py +0 -0
  368. {patchman-4.0.21 → patchman-4.0.24}/util/tests/__init__.py +0 -0
  369. {patchman-4.0.21 → patchman-4.0.24}/util/tests/test_commands.py +0 -0
  370. {patchman-4.0.21 → patchman-4.0.24}/util/urls.py +0 -0
  371. {patchman-4.0.21 → patchman-4.0.24}/util/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchman
3
- Version: 4.0.21
3
+ Version: 4.0.24
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
@@ -29,7 +29,7 @@ Requires-Dist: django-filter==25.1
29
29
  Requires-Dist: humanize==4.12.1
30
30
  Requires-Dist: version-utils==0.3.2
31
31
  Requires-Dist: python-magic==0.4.27
32
- Requires-Dist: gitpython==3.1.50
32
+ Requires-Dist: gitpython==3.1.58
33
33
  Requires-Dist: tenacity==8.2.3
34
34
  Requires-Dist: celery==5.4.0
35
35
  Requires-Dist: redis==6.4.0
@@ -0,0 +1 @@
1
+ 4.0.24
@@ -25,8 +25,8 @@ from packages.models import Package
25
25
  from packages.utils import get_or_create_package
26
26
  from patchman.signals import pbar_start, pbar_update
27
27
  from security.models import Reference
28
- from util import extract, get_url, run_concurrently
29
- from util.logging import clear_forked_pbar, error_message
28
+ from util import extract, get_url, run_concurrently, tz_aware_datetime
29
+ from util.logging import clear_forked_pbar, error_message, warning_message
30
30
 
31
31
 
32
32
  def extract_updateinfo(data, url, concurrent_processing=True, max_workers=25):
@@ -76,13 +76,31 @@ def process_updateinfo_erratum(update):
76
76
  e_name = update.find('id').text
77
77
  name, ref_type, urls = get_distro_data(e_name, e_type)
78
78
  synopsis = update.find('title').text
79
- issue_date = update.find('issued').attrib.get('date')
79
+ issue_date = get_updateinfo_issue_date(update)
80
+ if issue_date is None:
81
+ warning_message(text=f'No valid issued or updated date for {e_name}, skipping')
82
+ update.clear()
83
+ return
80
84
  e, created = get_or_create_erratum(name, e_type, issue_date, synopsis)
81
85
  add_updateinfo_erratum_references(e, update, ref_type, urls)
82
86
  add_updateinfo_packages(e, update)
83
87
  update.clear()
84
88
 
85
89
 
90
+ def get_updateinfo_issue_date(update):
91
+ """ Returns the issued date of an updateinfo erratum,
92
+ falling back to the updated date if there is no valid issued date
93
+ """
94
+ for tag in ('issued', 'updated'):
95
+ element = update.find(tag)
96
+ date = element.attrib.get('date') if element is not None else None
97
+ if date:
98
+ try:
99
+ return tz_aware_datetime(date)
100
+ except ValueError:
101
+ continue
102
+
103
+
86
104
  def get_distro_data(name, e_type):
87
105
  """ Adds distro-specific names and references to an Erratum
88
106
  """
@@ -0,0 +1,52 @@
1
+ # Copyright 2026 Marcus Furlong <furlongm@gmail.com>
2
+ #
3
+ # This file is part of Patchman.
4
+ #
5
+ # Patchman is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, version 3 only.
8
+ #
9
+ # Patchman is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with Patchman. If not, see <http://www.gnu.org/licenses/>
16
+
17
+ from datetime import datetime, timezone
18
+
19
+ from defusedxml import ElementTree
20
+ from django.test import TestCase
21
+
22
+ from errata.sources.repos.yum import get_updateinfo_issue_date
23
+
24
+
25
+ def make_update(dates):
26
+ return ElementTree.fromstring(f'<update type="security"><id>TEST-1</id>{dates}</update>')
27
+
28
+
29
+ class UpdateinfoIssueDateTests(TestCase):
30
+ """Tests for getting the issue date of an updateinfo erratum."""
31
+
32
+ def test_issued_date(self):
33
+ """Test the issued date is used when present."""
34
+ update = make_update('<issued date="2026-08-26 12:34:56"/><updated date="2026-09-01 00:00:00"/>')
35
+ self.assertEqual(
36
+ get_updateinfo_issue_date(update),
37
+ datetime(2026, 8, 26, 12, 34, 56, tzinfo=timezone.utc),
38
+ )
39
+
40
+ def test_falls_back_to_updated_date(self):
41
+ """Test the updated date is used when there is no issued date."""
42
+ update = make_update('<updated date="2026-09-01 00:00:00 UTC"/>')
43
+ self.assertEqual(get_updateinfo_issue_date(update), datetime(2026, 9, 1, tzinfo=timezone.utc))
44
+
45
+ def test_falls_back_when_issued_invalid(self):
46
+ """Test the updated date is used when the issued date is invalid."""
47
+ update = make_update('<issued date="bogus"/><updated date="1704067200"/>')
48
+ self.assertEqual(get_updateinfo_issue_date(update), datetime(2024, 1, 1, tzinfo=timezone.utc))
49
+
50
+ def test_no_valid_date(self):
51
+ """Test None is returned when there is no valid date."""
52
+ self.assertIsNone(get_updateinfo_issue_date(make_update('<issued/>')))
@@ -15,6 +15,7 @@
15
15
  # along with Patchman. If not, see <http://www.gnu.org/licenses/>
16
16
 
17
17
  from errata.models import Erratum
18
+ from hosts.utils import refresh_host_update_counts
18
19
  from packages.models import PackageUpdate
19
20
  from patchman.signals import pbar_start, pbar_update
20
21
  from util import fetch_concurrently, run_concurrently, tz_aware_datetime
@@ -72,6 +73,7 @@ def mark_errata_security_updates(concurrent_processing=True, max_workers=25):
72
73
  for i, e in enumerate(Erratum.objects.all()):
73
74
  e.scan_for_security_updates()
74
75
  pbar_update.send(sender=None, index=i + 1)
76
+ refresh_host_update_counts()
75
77
 
76
78
 
77
79
  def scan_security_worker(pk):
@@ -0,0 +1,34 @@
1
+ from django.db import migrations
2
+
3
+ LEGACY_TAGGING_TABLES = ['tagging_taggeditem', 'tagging_tag']
4
+
5
+
6
+ def drop_legacy_tagging(apps, schema_editor):
7
+ # 0004 never dropped the django-tagging column/tables on 3.x upgrades
8
+ conn = schema_editor.connection
9
+ q = schema_editor.quote_name
10
+ with conn.cursor() as cursor:
11
+ columns = [c.name for c in conn.introspection.get_table_description(cursor, 'hosts_host')]
12
+ tables = conn.introspection.table_names(cursor)
13
+
14
+ if 'tags' in columns:
15
+ if getattr(conn.features, 'can_alter_table_drop_column', True):
16
+ schema_editor.execute(f'ALTER TABLE {q("hosts_host")} DROP COLUMN {q("tags")}')
17
+ else:
18
+ # old sqlite: rebuilding the table from the model drops unknown columns
19
+ schema_editor._remake_table(apps.get_model('hosts', 'Host'))
20
+
21
+ for table in LEGACY_TAGGING_TABLES:
22
+ if table in tables:
23
+ schema_editor.execute(f'DROP TABLE {q(table)}')
24
+
25
+
26
+ class Migration(migrations.Migration):
27
+
28
+ dependencies = [
29
+ ('hosts', '0013_alter_hostrepo_unique_together_and_more'),
30
+ ]
31
+
32
+ operations = [
33
+ migrations.RunPython(drop_legacy_tagging, migrations.RunPython.noop),
34
+ ]
@@ -144,6 +144,17 @@ class Host(models.Model):
144
144
  if rlen > 0:
145
145
  info_message(text=f'{self.hostname}: removed {rlen} old reports')
146
146
 
147
+ def find_client_updates(self):
148
+ """ Returns the updates the client sent with its latest report. Host
149
+ packages come from the same report, so stale ones are dropped
150
+ """
151
+ from reports.models import Report
152
+ from reports.utils import find_client_updates
153
+ report = Report.objects.filter(host=self.hostname, processed=True).order_by('-created').first()
154
+ if report is None:
155
+ return []
156
+ return find_client_updates(self, report)
157
+
147
158
  def get_host_repo_packages(self):
148
159
  if self.host_repos_only:
149
160
  hostrepos_q = Q(mirror__repo__in=self.repos.all(),
@@ -214,6 +225,17 @@ class Host(models.Model):
214
225
  for ku_id in kernel_update_ids:
215
226
  update_ids.add(ku_id)
216
227
 
228
+ # client-reported updates come from the package manager, which knows
229
+ # about pins and repo priorities, so they replace the computed ones
230
+ client_updates = self.find_client_updates()
231
+ if client_updates:
232
+ client_oldpackage_ids = {u.oldpackage_id for u in client_updates}
233
+ update_ids = set(PackageUpdate.objects.filter(id__in=update_ids).exclude(
234
+ oldpackage_id__in=client_oldpackage_ids).values_list('id', flat=True))
235
+ for update in client_updates:
236
+ self.updates.add(update)
237
+ update_ids.add(update.id)
238
+
217
239
  for update in self.updates.all():
218
240
  if update.id not in update_ids:
219
241
  self.updates.remove(update)
@@ -633,6 +655,11 @@ class Host(models.Model):
633
655
  if running_kernel_pkg:
634
656
  for package in kernel_packages:
635
657
  if package.name.name.startswith('linux-image-'):
658
+ # skip meta-packages (e.g. linux-image-generic): their version
659
+ # (5.15.0.198.171) always sorts above the kernel they pull in
660
+ # (5.15.0-198.208), so they would flag a reboot on every host
661
+ if self.get_deb_kernel_series(package.name.name) is None:
662
+ continue
636
663
  flavour = self.get_deb_kernel_flavour(package.name.name)
637
664
  if running_flavour is None or flavour == running_flavour:
638
665
  if running_kernel_pkg.compare_version(package) == -1:
@@ -14,6 +14,8 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with Patchman. If not, see <http://www.gnu.org/licenses/>
16
16
 
17
+ import json
18
+
17
19
  from django.test import TestCase, override_settings
18
20
  from django.utils import timezone
19
21
 
@@ -22,6 +24,7 @@ from domains.models import Domain
22
24
  from hosts.models import Host, HostRepo
23
25
  from operatingsystems.models import OSRelease, OSVariant
24
26
  from packages.models import Package, PackageName, PackageUpdate
27
+ from reports.models import Report
25
28
  from repos.models import Mirror, MirrorPackage, Repository
26
29
 
27
30
 
@@ -362,3 +365,90 @@ class HostProcessUpdateTests(TestCase):
362
365
  update_id = self.host.process_update(old_pkg, new_pkg)
363
366
  update = PackageUpdate.objects.get(id=update_id)
364
367
  self.assertTrue(update.security)
368
+
369
+
370
+ @override_settings(
371
+ CELERY_TASK_ALWAYS_EAGER=True,
372
+ CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
373
+ )
374
+ class ClientReportedUpdatesTests(TestCase):
375
+ """Updates sent by the client must survive find_updates until a newer
376
+ report no longer applies them."""
377
+
378
+ def _report(self, packages, sec_updates='', bug_updates='', protocol='1'):
379
+ report = Report.objects.create(
380
+ host='client-updates.example.com',
381
+ domain='example.com',
382
+ report_ip='192.168.1.20',
383
+ os='Ubuntu 22.04',
384
+ kernel='5.15.0-91-generic',
385
+ arch='x86_64',
386
+ protocol=protocol,
387
+ packages=packages,
388
+ repos='' if protocol == '1' else '[]',
389
+ modules='' if protocol == '1' else '[]',
390
+ sec_updates=sec_updates,
391
+ bug_updates=bug_updates,
392
+ )
393
+ report.process()
394
+ return Host.objects.get(hostname='client-updates.example.com')
395
+
396
+ def test_apt_text_updates_without_repo(self):
397
+ """bash protocol 1 apt updates have no repo field."""
398
+ host = self._report(
399
+ "'nginx' '' '1.18.0' '6ubuntu14' 'amd64' 'deb'\n"
400
+ "'curl' '' '7.81.0' '1ubuntu1.14' 'amd64' 'deb'\n",
401
+ sec_updates='nginx.amd64 1.18.0-6ubuntu14.4\n',
402
+ bug_updates='curl.amd64 7.81.0-1ubuntu1.15\n',
403
+ )
404
+ updates = {u.newpackage.name.name: u for u in host.updates.all()}
405
+ self.assertEqual(set(updates), {'nginx', 'curl'})
406
+ self.assertEqual(updates['nginx'].newpackage.packagetype, Package.DEB)
407
+ self.assertEqual(updates['nginx'].newpackage.release, '6ubuntu14.4')
408
+ self.assertTrue(updates['nginx'].security)
409
+ self.assertFalse(updates['curl'].security)
410
+
411
+ def test_json_updates_survive_find_updates(self):
412
+ """A later find_updates run must not drop the client's updates."""
413
+ host = self._report(
414
+ json.dumps([{'name': 'nginx', 'epoch': '', 'version': '1.18.0',
415
+ 'release': '6ubuntu14', 'arch': 'amd64', 'type': 'deb'}]),
416
+ sec_updates=json.dumps([{'name': 'nginx', 'version': '1.18.0-6ubuntu14.4', 'arch': 'amd64'}]),
417
+ protocol='2',
418
+ )
419
+ host.find_updates()
420
+ self.assertEqual(host.updates.count(), 1)
421
+
422
+ def test_stale_client_updates_are_dropped(self):
423
+ """Once the package is updated, the old client update goes away."""
424
+ self._report(
425
+ "'nginx' '' '1.18.0' '6ubuntu14' 'amd64' 'deb'\n",
426
+ sec_updates='nginx.amd64 1.18.0-6ubuntu14.4\n',
427
+ )
428
+ host = self._report("'nginx' '' '1.18.0' '6ubuntu14.4' 'amd64' 'deb'\n")
429
+ self.assertEqual(host.updates.count(), 0)
430
+ host.find_updates()
431
+ self.assertEqual(host.updates.count(), 0)
432
+
433
+ def test_client_update_replaces_computed_update(self):
434
+ """The package manager's choice (pins, priorities) wins over the
435
+ newest version found in the host's repos."""
436
+ host = self._report(
437
+ "'nginx' '' '1.18.0' '6ubuntu14' 'amd64' 'deb'\n",
438
+ bug_updates='nginx.amd64 1.18.0-6ubuntu14.4\n',
439
+ )
440
+ machine_arch = MachineArchitecture.objects.get(name='x86_64')
441
+ repo = Repository.objects.create(name='pinned', arch=machine_arch, repotype=Repository.DEB, enabled=True)
442
+ mirror = Mirror.objects.create(repo=repo, url='http://pinned.example.com/', enabled=True, refresh=True)
443
+ HostRepo.objects.create(host=host, repo=repo, enabled=True)
444
+ newest = Package.objects.create(
445
+ name=PackageName.objects.get(name='nginx'),
446
+ arch=PackageArchitecture.objects.get(name='amd64'),
447
+ epoch='', version='1.24.0', release='1', packagetype=Package.DEB,
448
+ )
449
+ MirrorPackage.objects.create(mirror=mirror, package=newest)
450
+ host.find_updates()
451
+ self.assertEqual(
452
+ [(u.newpackage.version, u.newpackage.release) for u in host.updates.all()],
453
+ [('1.18.0', '6ubuntu14.4')],
454
+ )
@@ -0,0 +1,99 @@
1
+ # Copyright 2026 Marcus Furlong <furlongm@gmail.com>
2
+ #
3
+ # This file is part of Patchman.
4
+ #
5
+ # Patchman is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, version 3 only.
8
+ #
9
+ # Patchman is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with Patchman. If not, see <http://www.gnu.org/licenses/>
16
+
17
+ import json
18
+ from importlib import import_module
19
+
20
+ from django.apps import apps
21
+ from django.db import connection
22
+ from django.test import TransactionTestCase, override_settings
23
+
24
+ from hosts.models import Host
25
+ from reports.models import Report
26
+
27
+ migration = import_module('hosts.migrations.0014_drop_legacy_tagging')
28
+
29
+
30
+ def host_columns():
31
+ with connection.cursor() as cursor:
32
+ return [c.name for c in connection.introspection.get_table_description(cursor, 'hosts_host')]
33
+
34
+
35
+ def table_names():
36
+ with connection.cursor() as cursor:
37
+ return connection.introspection.table_names(cursor)
38
+
39
+
40
+ @override_settings(
41
+ CELERY_TASK_ALWAYS_EAGER=True,
42
+ CACHES={'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
43
+ )
44
+ class DropLegacyTaggingTests(TransactionTestCase):
45
+ """Tests for hosts migration 0014 (leftover django-tagging schema, #690)."""
46
+
47
+ def setUp(self):
48
+ self.addCleanup(self.run_migration)
49
+
50
+ def run_migration(self):
51
+ with connection.schema_editor() as schema_editor:
52
+ migration.drop_legacy_tagging(apps, schema_editor)
53
+
54
+ def add_legacy_schema(self):
55
+ with connection.cursor() as cursor:
56
+ cursor.execute('ALTER TABLE hosts_host ADD COLUMN tags varchar(255) CHECK (tags IS NOT NULL)')
57
+ cursor.execute('CREATE TABLE tagging_tag (id integer PRIMARY KEY, name varchar(50))')
58
+ cursor.execute(
59
+ 'CREATE TABLE tagging_taggeditem '
60
+ '(id integer PRIMARY KEY, tag_id integer REFERENCES tagging_tag (id))'
61
+ )
62
+
63
+ def create_report(self):
64
+ return Report.objects.create(
65
+ host='legacy.example.com',
66
+ domain='example.com',
67
+ report_ip='192.168.1.10',
68
+ os='Ubuntu 22.04.3 LTS',
69
+ kernel='5.15.0-91-generic',
70
+ arch='x86_64',
71
+ protocol='2',
72
+ packages=json.dumps([]),
73
+ repos=json.dumps([]),
74
+ modules=json.dumps([]),
75
+ sec_updates=json.dumps([]),
76
+ bug_updates=json.dumps([]),
77
+ )
78
+
79
+ def test_legacy_column_does_not_crash_report_processing(self):
80
+ """Host creation fails on the legacy column; process() must not raise."""
81
+ self.add_legacy_schema()
82
+ self.create_report().process(find_updates=False)
83
+ self.assertFalse(Host.objects.filter(hostname='legacy.example.com').exists())
84
+
85
+ def test_drops_legacy_column_and_tables(self):
86
+ """Leftover tags column and tagging tables are dropped; hosts can be created again."""
87
+ self.add_legacy_schema()
88
+ self.run_migration()
89
+ self.assertNotIn('tags', host_columns())
90
+ self.assertNotIn('tagging_tag', table_names())
91
+ self.assertNotIn('tagging_taggeditem', table_names())
92
+ self.create_report().process(find_updates=False)
93
+ self.assertTrue(Host.objects.filter(hostname='legacy.example.com').exists())
94
+
95
+ def test_noop_on_clean_schema(self):
96
+ """Fresh installs have nothing to drop."""
97
+ before = host_columns()
98
+ self.run_migration()
99
+ self.assertEqual(host_columns(), before)
@@ -543,6 +543,45 @@ class DebKernelUpdateTests(TestCase):
543
543
  self.assertEqual(update.oldpackage, self.img_51)
544
544
  self.assertEqual(update.newpackage, self.img_53)
545
545
 
546
+ def test_deb_reboot_required_newer_kernel_installed(self):
547
+ """DEB: newer kernel installed but not running. Reboot required."""
548
+ host = self._create_host(
549
+ '6.8.0-51-generic',
550
+ [self.img_49, self.img_51, self.img_53],
551
+ )
552
+ repo_packages = Package.objects.filter(mirror=self.mirror)
553
+ kernel_packages = host.packages.filter(
554
+ name__name__startswith='linux-image-'
555
+ )
556
+
557
+ host.find_kernel_updates(kernel_packages, repo_packages)
558
+
559
+ self.assertTrue(host.reboot_required)
560
+
561
+ def test_deb_meta_package_does_not_require_reboot(self):
562
+ """DEB: running the latest kernel with linux-image-generic installed.
563
+
564
+ The meta-package version (6.8.0.53.54) sorts above the kernel it
565
+ depends on (6.8.0-53.54) and must not flag a reboot.
566
+ """
567
+ meta_name = PackageName.objects.create(name='linux-image-generic')
568
+ meta = Package.objects.create(
569
+ name=meta_name, arch=self.pkg_arch, epoch='',
570
+ version='6.8.0.53.54', release='', packagetype='D'
571
+ )
572
+ host = self._create_host(
573
+ '6.8.0-53-generic',
574
+ [self.img_49, self.img_53, meta],
575
+ )
576
+ repo_packages = Package.objects.filter(mirror=self.mirror)
577
+ kernel_packages = host.packages.filter(
578
+ name__name__startswith='linux-image-'
579
+ )
580
+
581
+ host.find_kernel_updates(kernel_packages, repo_packages)
582
+
583
+ self.assertFalse(host.reboot_required)
584
+
546
585
  def test_deb_flavour_extraction(self):
547
586
  """Test get_deb_kernel_flavour helper."""
548
587
  host = self._create_host('6.8.0-51-generic', [self.img_51])
@@ -0,0 +1,91 @@
1
+ # Copyright 2026 Marcus Furlong <furlongm@gmail.com>
2
+ #
3
+ # This file is part of Patchman.
4
+ #
5
+ # Patchman is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, version 3 only.
8
+ #
9
+ # Patchman is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with Patchman. If not, see <http://www.gnu.org/licenses/>
16
+
17
+ from unittest.mock import patch
18
+
19
+ from django.test import TestCase
20
+ from django.utils import timezone
21
+
22
+ from arch.models import MachineArchitecture, PackageArchitecture
23
+ from domains.models import Domain
24
+ from errata.models import Erratum
25
+ from errata.utils import mark_errata_security_updates
26
+ from hosts.models import Host
27
+ from hosts.utils import get_or_create_host
28
+ from operatingsystems.models import OSRelease, OSVariant
29
+ from packages.models import Package, PackageName, PackageUpdate
30
+ from reports.models import Report
31
+
32
+
33
+ @patch('hosts.models.Host.check_rdns')
34
+ class GetOrCreateHostTagTests(TestCase):
35
+
36
+ def setUp(self):
37
+ self.arch = MachineArchitecture.objects.create(name='x86_64')
38
+ self.domain = Domain.objects.create(name='example.com')
39
+ self.osvariant = OSVariant.objects.create(
40
+ name='Debian 13', osrelease=OSRelease.objects.create(name='Debian 13'),
41
+ )
42
+
43
+ def host_tags(self, protocol, tags):
44
+ report = Report.objects.create(
45
+ host='tags.example.com', report_ip='192.168.1.10', os='Debian 13',
46
+ kernel='6.12.57+deb13-amd64', arch='x86_64', protocol=protocol, tags=tags,
47
+ )
48
+ host = get_or_create_host(report, self.arch, self.osvariant, self.domain)
49
+ return sorted(host.tags.names())
50
+
51
+ def test_protocol1_space_delimited(self, _):
52
+ self.assertEqual(self.host_tags('1', 'web prod'), ['prod', 'web'])
53
+
54
+ def test_protocol1_comma_delimited(self, _):
55
+ self.assertEqual(self.host_tags('1', 'web, prod'), ['prod', 'web'])
56
+
57
+ def test_protocol2_keeps_spaces_within_tags(self, _):
58
+ self.assertEqual(self.host_tags('2', 'my tag, web'), ['my tag', 'web'])
59
+
60
+ def test_protocol2_empty_tags(self, _):
61
+ self.assertEqual(self.host_tags('2', ''), [])
62
+
63
+
64
+ class RefreshHostUpdateCountsTests(TestCase):
65
+
66
+ def test_counts_refreshed_after_errata_security_marking(self):
67
+ os_release = OSRelease.objects.create(name='Debian 13')
68
+ host = Host.objects.create(
69
+ hostname='h.example.com', ipaddress='192.0.2.1',
70
+ osvariant=OSVariant.objects.create(name='Debian 13', osrelease=os_release),
71
+ kernel='6.12.0', arch=MachineArchitecture.objects.create(name='x86_64'),
72
+ domain=Domain.objects.create(name='example.com'),
73
+ lastreport=timezone.now(),
74
+ )
75
+ pkg_arch = PackageArchitecture.objects.create(name='amd64')
76
+ name = PackageName.objects.create(name='curl')
77
+ old = Package.objects.create(name=name, arch=pkg_arch, epoch='', version='1', release='1', packagetype='D')
78
+ new = Package.objects.create(name=name, arch=pkg_arch, epoch='', version='2', release='1', packagetype='D')
79
+ update = PackageUpdate.objects.create(oldpackage=old, newpackage=new, security=False)
80
+ host.updates.add(update)
81
+ host.refresh_from_db()
82
+ self.assertEqual((host.sec_updates_count, host.bug_updates_count), (0, 1))
83
+
84
+ erratum = Erratum.objects.create(
85
+ name='DSA-0000-1', e_type='security', issue_date=timezone.now(), synopsis='curl',
86
+ )
87
+ erratum.fixed_packages.add(new)
88
+ mark_errata_security_updates(concurrent_processing=False)
89
+
90
+ host.refresh_from_db()
91
+ self.assertEqual((host.sec_updates_count, host.bug_updates_count), (1, 0))
@@ -18,7 +18,10 @@
18
18
  from socket import gaierror, gethostbyaddr, herror
19
19
 
20
20
  from django.db import IntegrityError, transaction
21
+ from django.db.models import Count, OuterRef, Subquery
22
+ from django.db.models.functions import Coalesce
21
23
  from taggit.models import Tag
24
+ from taggit.utils import parse_tags
22
25
 
23
26
  from util import get_datetime_now
24
27
  from util.logging import error_message, info_message
@@ -36,6 +39,36 @@ def update_rdns(host):
36
39
  host.save()
37
40
 
38
41
 
42
+ def refresh_host_update_counts():
43
+ """ Recalculate cached security/bugfix update counts for all hosts.
44
+ Needed when PackageUpdate.security changes, as that does not fire
45
+ the Host.updates m2m_changed signal.
46
+ """
47
+ from hosts.models import Host
48
+ through = Host.updates.through
49
+
50
+ def count_updates(security):
51
+ counts = through.objects.filter(
52
+ host_id=OuterRef('pk'),
53
+ packageupdate__security=security,
54
+ ).values('host_id').annotate(c=Count('pk')).values('c')
55
+ return Coalesce(Subquery(counts), 0)
56
+
57
+ Host.objects.update(
58
+ sec_updates_count=count_updates(True),
59
+ bug_updates_count=count_updates(False),
60
+ )
61
+
62
+
63
+ def get_report_tags(report):
64
+ """ Protocol 2 sends a list (stored comma-joined), protocol 1 sends the
65
+ raw config string, which may be comma or space delimited
66
+ """
67
+ if report.protocol == '2':
68
+ return [t.strip() for t in (report.tags or '').split(',') if t.strip()]
69
+ return parse_tags(report.tags or '')
70
+
71
+
39
72
  def get_or_create_host(report, arch, osvariant, domain):
40
73
  """ Get or create a host from from a report
41
74
  """
@@ -46,6 +79,7 @@ def get_or_create_host(report, arch, osvariant, domain):
46
79
  except herror:
47
80
  report.host = report.report_ip
48
81
  report.save()
82
+ host = None
49
83
  try:
50
84
  with transaction.atomic():
51
85
  host, created = Host.objects.get_or_create(
@@ -64,7 +98,7 @@ def get_or_create_host(report, arch, osvariant, domain):
64
98
  host.osvariant = osvariant
65
99
  host.domain = domain
66
100
  host.lastreport = report.created
67
- host.tags.set(report.tags.split(','), clear=True)
101
+ host.tags.set(get_report_tags(report), clear=True)
68
102
  if report.reboot == 'True':
69
103
  host.reboot_required = True
70
104
  else:
@@ -183,7 +183,7 @@ class PackageString(models.Model):
183
183
  epoch = models.CharField(max_length=128, blank=True, null=True)
184
184
  release = models.CharField(max_length=128, blank=True, null=True)
185
185
  arch = models.CharField(max_length=128)
186
- packagetype = models.CharField(max_length=1, blank=True, null=True)
186
+ packagetype = models.CharField(max_length=1, choices=Package.PACKAGE_TYPES, blank=True, null=True)
187
187
  category = models.CharField(max_length=128, blank=True, null=True)
188
188
  description = models.TextField(blank=True, null=True)
189
189
  url = models.URLField(max_length=255, blank=True, null=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchman
3
- Version: 4.0.21
3
+ Version: 4.0.24
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
@@ -29,7 +29,7 @@ Requires-Dist: django-filter==25.1
29
29
  Requires-Dist: humanize==4.12.1
30
30
  Requires-Dist: version-utils==0.3.2
31
31
  Requires-Dist: python-magic==0.4.27
32
- Requires-Dist: gitpython==3.1.50
32
+ Requires-Dist: gitpython==3.1.58
33
33
  Requires-Dist: tenacity==8.2.3
34
34
  Requires-Dist: celery==5.4.0
35
35
  Requires-Dist: redis==6.4.0