You are right, this looks like a bug in the medium provider code introduced by the fix for Bug #25733: Media provider unique ID does not work for Debian-based distros - Foreman which assumes all operating systems have the pxedir
method. Can you please open a report for this issue on our redmine tracker?
Until the bug is properly fixed, you could try working around it by changing that line (should be under /usr/share/foreman/app/services/medium_providers/default.rb
) to:
digest = Base64.urlsafe_encode64(Digest::SHA1.digest(medium_uri(entity.operatingsystem.try(:pxedir)).to_s), padding: false)
and restarting the httpd service.