New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expired Katello hosts are unable to be deleted #21
Comments
@steveh138: Thanks for the report. I don't want to start a blame game here, but this looks like Katello needs some special treatment. I'll look into it. |
I've asked for some insights on the foreman mailing list. It looks like we need to treat katello in a special way. @steveh138: If I provide you with a patch, could you try if it fixes the issue for you and let me know? |
Yes. I'd be more than happy to test. @timogoebel |
@timogoebel did you still have a patch you wanted me to try? |
@steveh138: Not just yet, sorry. But I hope that I'll have one by the end of the week. Sorry for the delay. |
@timogoebel No worries. Just wanted to check in. TY for the help. :) |
@steveh138: Sorry for the long turnaround, can you test the code in #22? Thanks. |
No problem. I'll test it out today |
Unfortunately it's still not working. This time the rake fails to run.
|
@steveh138: Sorry, a little bug sneaked in the code and I did not test it myself. diff --git a/app/services/foreman_expire_hosts/safe_destroy.rb b/app/services/foreman_expire_hosts/safe_destroy.rb
index e0c0f8f..23edba0 100644
--- a/app/services/foreman_expire_hosts/safe_destroy.rb
+++ b/app/services/foreman_expire_hosts/safe_destroy.rb
@@ -13,7 +13,7 @@ module ForemanExpireHosts
# See https://community.theforeman.org/t/how-to-properly-destroy-a-content-host/8621
# for reasoning.
if with_katello?
- ForemanTasks.sync_task(::Actions::Katello::Host::Destroy, @host)
+ ForemanTasks.sync_task(::Actions::Katello::Host::Destroy, subject)
else
subject.destroy!
end |
That seems to have done the trick. I'm installing a new host to ensure the cron task works the same (which it should since it's the same command). Thank you for getting this fixed. :-D |
@steveh138: Excellent. Please let me know when you have finished your testing and I will merge the PR so we can cut a new release that includes the fix. |
The overnight deletion worked. Thank you again for all the help. :) |
Expired hosts are unable to be deleted automatically. I can delete them using the API and from the webui. Logs below
/usr/sbin/foreman-rake expired_hosts:deliver_notifications
The text was updated successfully, but these errors were encountered: