Class: Superhosting::Controller::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/superhosting/controller/base.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #lib

Instance Method Summary collapse

Methods inherited from Base

#get_base_controller_options, #get_controller, #initialize

Methods included from Helpers

#instance_variables_to_hash

Methods included from Helper::Config

#_config, #_config_options, #_save_registry!, #apply, #configure, #configure_with_apply, #reconfig, #unapply, #unconfigure, #unconfigure_with_unapply

Methods included from Helper::Cmd

#_command, #_command_without_debug, #command, #command!

Methods included from Helper::File

#chmod!, #chown!, #chown_r!, #safe_link!, #safe_unlink!

Methods included from Helper::Logger

#__debug, #__dry_run, #__dry_run=, #__logger, #__logger=, #debug, #debug_block, #debug_operation, #indent, #indent=, #indent_reset, #indent_step, #indent_step_back, #info, #storage, #t, #with_dry_run, #with_indent, #with_logger

Constructor Details

This class inherits a constructor from Superhosting::Base

Instance Method Details

#repairObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/superhosting/controller/base.rb', line 4

def repair
  container_controller = self.get_controller(Container)
  container_controller.index.each do |container_name, hash_of_mappers|
    if hash_of_mappers[:state_mapper].value != 'up'
      container_controller.reconfigure(name: container_name).net_status_ok!
    else
      container_controller._each_site(name: container_name) do |controller, name, state|
        controller.reconfigure(name: name).net_status_ok! if state != 'up'
      end
    end
  end
end