lib/open-dock/base.rb in open-dock-0.1.6 vs lib/open-dock/base.rb in open-dock-0.1.7

- old
+ new

@@ -1,16 +1,17 @@ module Ops HOSTS_DIR = "hosts" CONTAINERS_DIR = "containers" PROVIDERS_DIR = "providers" + DEFAULT_USER = "root" - def self.get_user_for(host_name) host_file = "#{HOSTS_DIR}/#{host_name}.yml" - begin + if File.exist? host_file params = YAML.load_file host_file - params["user"] - rescue - raise "Please, create '#{host_file}' configuring your host" + if params and params.has_key? "user" + return params["user"] + end end + return DEFAULT_USER end end \ No newline at end of file