Bug #37589
closedMonitor -> Host statusses shows "Pending Installation" instead of Installed
Description
I have found (any mostly) analyzed the issuse, that after provisioning a host the build status is not stored on DB. Means, the BuildStatus->to_status is 1 but BuildStatus->status is 0. the before_validation to refresh_build_status in host/managed is called and the status in the object is changed from pending installation to installed but it doesn't change the status object in DB. Therefore, if you go to HostOverview page and click on "Details" the Host is still in "Pending Installation". If you go to the host directly the "to_status" (or to_label) method is called which doesn't grab the value from DB but uses the "build" flag
irb(main):082:0> Host.last.host_statuses.first => #<HostStatus::BuildStatus id: 35, type: "HostStatus::BuildStatus", status: 1, host_id: 9, reported_at: [FILTERED]> irb(main):083:0> Host.last.host_statuses.first.to_label => "Pending installation" irb(main):084:0> Host.last.host_statuses.first.to_status => 1 irb(main):085:0> Host.second.host_statuses.first => #<HostStatus::BuildStatus id: 2, type: "HostStatus::BuildStatus", status: 1, host_id: 2, reported_at: [FILTERED]> irb(main):086:0> Host.second.host_statuses.first.to_label => "Installed" irb(main):087:0> Host.second.host_statuses.first.to_status => 0
First impression was: its just a UI issue. But if you have a closer look, the BuildStatus is now saved correctly in the DB which may have some other strange drawbacks.
Updated by The Foreman Bot 3 months ago
- Status changed from New to Ready For Testing
- Assignee set to Bernhard Suttner
- Pull request https://github.com/theforeman/foreman/pull/10224 added
Updated by Bernhard Suttner 3 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|f0e26553b555a953eaff4253e00f2085c8bc3768.
Updated by Ewoud Kohl van Wijngaarden about 1 month ago
- Category set to Unattended installations
- Triaged changed from No to Yes