Class: Katello::HostTracer
- Includes:
- Authorization::HostTracer
- Defined in:
- app/models/katello/host_tracer.rb
Constant Summary collapse
- TRACE_APP_TYPE_STATIC =
'static'.freeze
- TRACE_APP_TYPE_SESSION =
'session'.freeze
- TRACE_APP_TYPE_DAEMON =
'daemon'.freeze
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
Class Method Details
.helpers_for(traces) ⇒ Object
38 39 40 41 42 43 44 |
# File 'app/models/katello/host_tracer.rb', line 38 def self.helpers_for(traces) if traces.any?(&:reboot_required?) ['reboot'] else traces.map(&:restart_command).compact.uniq end end |
Instance Method Details
#reboot_required? ⇒ Boolean
23 24 25 |
# File 'app/models/katello/host_tracer.rb', line 23 def reboot_required? self.app_type == TRACE_APP_TYPE_STATIC end |
#restart_command ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'app/models/katello/host_tracer.rb', line 27 def restart_command case self.app_type when TRACE_APP_TYPE_STATIC 'reboot' when TRACE_APP_TYPE_SESSION nil else self.helper end end |