Project

General

Profile

Refactor #22219

Refactor validate_media? to be hookable

Added by Lukas Zapletal over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Katello plugin needs to hook into validate_media? method. When Bootdisk added new provisioning method, there are now two methods which needs media to be present: build (pxe) and boodisk. Katello needs to disable media validation when content source is set, but this can't be done via single hook point, because either build or bootdisk method is always true:

super || (managed && bootdisk_build? && build?)

We need to refactor this in a way that katello can hook it. One idea is to create method for each individual method:

  • validate_image_media? (returns always false)
  • validate_build_media?
  • validate_bootdisk_media? (created by bootdisk plugin)

So Katello can hook individually. But in this case initializers in Katello must be changed - host extensions must be called after boodisk creates the method (perhaps via after_initialize block).


Related issues

Related to Boot disk - Bug #14797: Medium validation wrong with Katello and foreman_bootdiskClosed

History

#1 Updated by Lukas Zapletal over 1 year ago

  • Related to Bug #14797: Medium validation wrong with Katello and foreman_bootdisk added

Also available in: Atom PDF