# File lib/mcollective/util.rb, line 157 def self.config_file_for_user # the set of acceptable config files config_paths = [] # user dotfile begin # File.expand_path will raise if HOME isn't set, catch it user_path = File.expand_path("~/.mcollective") config_paths << user_path rescue Exception end # standard locations if self.windows? config_paths << File.join(self.windows_prefix, 'etc', 'client.cfg') else config_paths << '/etc/puppetlabs/mcollective/client.cfg' config_paths << '/etc/mcollective/client.cfg' end # use the first readable config file, or if none are the first listed found = config_paths.find_index { |file| File.readable?(file) } || 0 return config_paths[found] end