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 24, 2018
1 parent c74c4df commit a474886
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/helpers/hosts_helper.rb
Expand Up @@ -303,8 +303,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 to_status
when PENDING
N_("Installation haven't started yet or it is in progress")
when TOKEN_EXPIRED
N_("Build token is no longer valid, cancel build mode and enter it again to generate new token")
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
4 changes: 4 additions & 0 deletions app/models/host_status/status.rb
Expand Up @@ -72,6 +72,10 @@ def update_timestamp
def update_status
self.status = to_status
end

def remediation_help_text
nil
end
end
end

Expand Down

0 comments on commit a474886

Please sign in to comment.