Description of problem:
When a provisioning token for a host is expired, downloading a bootdisk for the host effectively generates an outdated image (with the invalid token) and thus making the images useless.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create a host record
2. [optionally shorten the token validity time]
3. wait for the token to expire
4. generate a full host image
5. try to boot it
kickstart file is unable to retrieve as the old, invalid token is used
Downloading of the bootdisk should involce re-generating a provisioning token
Ideally, there should be a warning dialog with an option to confirm the refreshing of the token.
This would save the effort of generating and downloading of an useless image.
There is one problem tho - to generate token, host must be in build mode. And download action shoud NOT turn on build mode, because if user accidentally does this and reboot, the host can get reprovisioned if PXE is setup correctly. Data loss. Therefore we MUST error out instead of generating new token asking the user to enter build mode (which creates a new token).
Minor issue, I don't have the capacity to work on this one. I created an upstream bug for this: https://projects.theforeman.org/issues/31673 - feel free to reopen if needed.
Correction, upstream bug: https://projects.theforeman.org/issues/31674