Class: Chef::Config

Inherits:
Object show all
Extended by:
Mixlib::Config
Defined in:
lib/chef/config.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inspectObject


46
47
48
# File 'lib/chef/config.rb', line 46

def self.inspect
  configuration.inspect
end

.manage_secret_keyObject

Manages the chef secret session key

Returns

<newkey>

A new or retrieved session key


33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chef/config.rb', line 33

def self.manage_secret_key
  newkey = nil
  if Chef::FileCache.has_key?("chef_server_cookie_id")
    newkey = Chef::FileCache.load("chef_server_cookie_id")
  else
    chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
    newkey = ""
    40.times { |i| newkey << chars[rand(chars.size-1)] }
    Chef::FileCache.store("chef_server_cookie_id", newkey)
  end
  newkey
end

.platform_specific_path(path) ⇒ Object


50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/chef/config.rb', line 50

def self.platform_specific_path(path)
  #10.times { puts "* " * 40}
  #pp caller

  if RUBY_PLATFORM =~ /mswin|mingw|windows/
    # turns /etc/chef/client.rb into C:/chef/client.rb
    system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : ""
    path = File.join(system_drive, path.split('/')[2..-1])
    # ensure all forward slashes are backslashes
    path.gsub!(File::SEPARATOR, (File::ALT_SEPARATOR || '\\'))
  end
  path
end

Instance Method Details

#nilObject

Daemonization Settings ## What user should Chef run as?


166
# File 'lib/chef/config.rb', line 166

user nil