Sha256: e6d4a703cc31bc23834d5c136f126d8bfbe9fb4fb7ca724a59856f9f27ea9462

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

require 'fileutils'

module ManageIQ
module ApplianceConsole
  class DatabaseMaintenance
    include ManageIQ::ApplianceConsole::Logging

    attr_accessor :hourly, :executed_hourly_action, :requested_hourly_action
    attr_accessor :periodic, :executed_periodic_action, :requested_periodic_action

    def initialize
      self.hourly   = ManageIQ::ApplianceConsole::DatabaseMaintenanceHourly.new
      self.periodic = ManageIQ::ApplianceConsole::DatabaseMaintenancePeriodic.new
      self.requested_hourly_action = false
      self.requested_periodic_action = false
      self.executed_hourly_action = false
      self.executed_periodic_action = false
    end

    def ask_questions
      clear_screen
      self.requested_hourly_action = hourly.confirm
      self.requested_periodic_action = periodic.confirm
      requested_hourly_action || requested_periodic_action
    end

    def activate
      say("Configuring Database Maintenance...")
      self.executed_hourly_action = hourly.activate
      self.executed_periodic_action = periodic.activate
      executed_hourly_action || executed_periodic_action
    end
  end # class DatabaseMaintenance
end # module ApplianceConsole
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
manageiq-appliance_console-1.2.4 lib/manageiq/appliance_console/database_maintenance.rb
manageiq-appliance_console-1.2.3 lib/manageiq/appliance_console/database_maintenance.rb
manageiq-appliance_console-1.2.2 lib/manageiq/appliance_console/database_maintenance.rb
manageiq-appliance_console-1.2.1 lib/manageiq/appliance_console/database_maintenance.rb
manageiq-appliance_console-1.2.0 lib/manageiq/appliance_console/database_maintenance.rb