Skip to content

Commit

Permalink
Fixes #23699 - Remediation Support for Host Status
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-mendhe committed Oct 16, 2018
1 parent 8db9cc0 commit b3fed67
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/helpers/hosts_helper.rb
Expand Up @@ -302,8 +302,10 @@ def host_detailed_status_list(host)
next unless status.relevant? && !status.substatus?
[
_(status.name),
content_tag(:span, ' '.html_safe, :class => host_global_status_icon_class(status.to_global)) +
content_tag(:span, (
content_tag(:span, ' '.html_safe, :class => host_global_status_icon_class(status.to_global)) +
content_tag(:span, _(status.to_label), :class => host_global_status_class(status.to_global))
), { :'data-original-title' => _(status.remediation_help_text), :rel => 'twipsy' })
]
end.compact
end
Expand Down
15 changes: 15 additions & 0 deletions app/models/host_status/build_status.rb
Expand Up @@ -64,6 +64,21 @@ def token_expired?
def build_errors?
host && host.build_errors.present?
end

def remediation_help_text
case host.build_status
when PENDING
N_("Install media and if build fails, rebuild again")
when TOKEN_EXPIRED
N_("Cancel your build and regenerate token by initiating build again")
when BUILT
N_("OS installer reported end of installation and rebooted the system")
when BUILD_FAILED
N_("OS installer post script reported failure, check logs")
else
N_("The host was not scheduled for build yet")
end
end
end
end

Expand Down

0 comments on commit b3fed67

Please sign in to comment.