Project

General

Profile

Actions

Refactor #22219

open

Refactor validate_media? to be hookable

Added by Lukas Zapletal over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Boot disk - Bug #14797: Medium validation wrong with Katello and foreman_bootdiskClosedLukas ZapletalActions
Actions #1

Updated by Lukas Zapletal over 6 years ago

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

Also available in: Atom PDF