Module: Ops

Defined in:
lib/open-dock/base.rb

Constant Summary collapse

HOSTS_DIR =
"hosts"
CONTAINERS_DIR =
"containers"
PROVIDERS_DIR =
"providers"
NODES_DIR =
"nodes"
DEFAULT_USER =
"root"

Class Method Summary collapse

Class Method Details

.get_user_for(host_name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/open-dock/base.rb', line 8

def self.get_user_for(host_name)
  host_file = "#{HOSTS_DIR}/#{host_name}.yml"
  if File.exist? host_file
    params = YAML.load_file host_file
    if params and params.has_key? "user"
      return params["user"]
    end
  end
  return DEFAULT_USER
end