chef 0.9.6 → 0.9.8.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/lib/chef/application.rb +19 -3
  2. data/lib/chef/application/client.rb +7 -8
  3. data/lib/chef/application/knife.rb +9 -3
  4. data/lib/chef/application/solo.rb +5 -5
  5. data/lib/chef/cache/checksum.rb +2 -2
  6. data/lib/chef/client.rb +30 -64
  7. data/lib/chef/config.rb +52 -30
  8. data/lib/chef/cookbook/metadata.rb +12 -1
  9. data/lib/chef/cookbook_site_streaming_uploader.rb +211 -0
  10. data/lib/chef/cookbook_uploader.rb +102 -0
  11. data/lib/chef/cookbook_version.rb +47 -30
  12. data/lib/chef/couchdb.rb +1 -11
  13. data/lib/chef/exceptions.rb +1 -0
  14. data/lib/chef/file_access_control.rb +1 -1
  15. data/lib/chef/index_queue/amqp_client.rb +10 -3
  16. data/lib/chef/knife.rb +154 -58
  17. data/lib/chef/knife/bootstrap.rb +84 -48
  18. data/lib/chef/knife/bootstrap/centos5-gems.erb +41 -0
  19. data/lib/chef/knife/bootstrap/fedora13-gems.erb +38 -0
  20. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +44 -0
  21. data/lib/chef/knife/client_bulk_delete.rb +1 -1
  22. data/lib/chef/knife/client_create.rb +1 -1
  23. data/lib/chef/knife/client_delete.rb +1 -1
  24. data/lib/chef/knife/client_edit.rb +1 -1
  25. data/lib/chef/knife/client_list.rb +1 -1
  26. data/lib/chef/knife/client_reregister.rb +1 -1
  27. data/lib/chef/knife/client_show.rb +1 -1
  28. data/lib/chef/knife/configure.rb +1 -1
  29. data/lib/chef/knife/configure_client.rb +1 -1
  30. data/lib/chef/knife/cookbook_bulk_delete.rb +1 -1
  31. data/lib/chef/knife/cookbook_create.rb +159 -0
  32. data/lib/chef/knife/cookbook_delete.rb +6 -6
  33. data/lib/chef/knife/cookbook_download.rb +1 -1
  34. data/lib/chef/knife/cookbook_list.rb +1 -1
  35. data/lib/chef/knife/cookbook_metadata.rb +1 -1
  36. data/lib/chef/knife/cookbook_metadata_from_file.rb +1 -1
  37. data/lib/chef/knife/cookbook_show.rb +1 -1
  38. data/lib/chef/knife/cookbook_site_download.rb +2 -1
  39. data/lib/chef/knife/cookbook_site_list.rb +2 -1
  40. data/lib/chef/knife/cookbook_site_search.rb +2 -1
  41. data/lib/chef/knife/cookbook_site_share.rb +108 -0
  42. data/lib/chef/knife/cookbook_site_show.rb +2 -1
  43. data/lib/chef/knife/cookbook_site_unshare.rb +52 -0
  44. data/lib/chef/knife/cookbook_site_vendor.rb +3 -2
  45. data/lib/chef/knife/cookbook_test.rb +1 -1
  46. data/lib/chef/knife/cookbook_upload.rb +22 -155
  47. data/lib/chef/knife/data_bag_create.rb +2 -1
  48. data/lib/chef/knife/data_bag_delete.rb +2 -1
  49. data/lib/chef/knife/data_bag_edit.rb +2 -1
  50. data/lib/chef/knife/data_bag_from_file.rb +2 -1
  51. data/lib/chef/knife/data_bag_list.rb +2 -1
  52. data/lib/chef/knife/data_bag_show.rb +2 -1
  53. data/lib/chef/knife/ec2_instance_data.rb +1 -1
  54. data/lib/chef/knife/ec2_server_create.rb +16 -4
  55. data/lib/chef/knife/ec2_server_delete.rb +8 -2
  56. data/lib/chef/knife/ec2_server_list.rb +8 -2
  57. data/lib/chef/knife/index_rebuild.rb +1 -1
  58. data/lib/chef/knife/node_bulk_delete.rb +1 -1
  59. data/lib/chef/knife/node_create.rb +1 -1
  60. data/lib/chef/knife/node_delete.rb +1 -1
  61. data/lib/chef/knife/node_edit.rb +1 -1
  62. data/lib/chef/knife/node_from_file.rb +1 -1
  63. data/lib/chef/knife/node_list.rb +1 -1
  64. data/lib/chef/knife/node_run_list_add.rb +1 -1
  65. data/lib/chef/knife/node_run_list_remove.rb +1 -1
  66. data/lib/chef/knife/node_show.rb +1 -1
  67. data/lib/chef/knife/rackspace_server_create.rb +1 -1
  68. data/lib/chef/knife/rackspace_server_delete.rb +1 -1
  69. data/lib/chef/knife/rackspace_server_list.rb +1 -1
  70. data/lib/chef/knife/recipe_list.rb +1 -1
  71. data/lib/chef/knife/role_bulk_delete.rb +1 -1
  72. data/lib/chef/knife/role_create.rb +1 -1
  73. data/lib/chef/knife/role_delete.rb +1 -1
  74. data/lib/chef/knife/role_edit.rb +1 -1
  75. data/lib/chef/knife/role_from_file.rb +1 -1
  76. data/lib/chef/knife/role_list.rb +1 -1
  77. data/lib/chef/knife/role_show.rb +1 -1
  78. data/lib/chef/knife/search.rb +1 -1
  79. data/lib/chef/knife/slicehost_images_list.rb +1 -1
  80. data/lib/chef/knife/slicehost_server_create.rb +1 -1
  81. data/lib/chef/knife/slicehost_server_delete.rb +1 -1
  82. data/lib/chef/knife/slicehost_server_list.rb +1 -1
  83. data/lib/chef/knife/ssh.rb +49 -9
  84. data/lib/chef/knife/status.rb +2 -2
  85. data/lib/chef/knife/terremark_server_create.rb +1 -1
  86. data/lib/chef/knife/terremark_server_delete.rb +1 -1
  87. data/lib/chef/knife/terremark_server_list.rb +1 -1
  88. data/lib/chef/mixin/command.rb +17 -204
  89. data/lib/chef/mixin/command/unix.rb +215 -0
  90. data/lib/chef/mixin/command/windows.rb +72 -0
  91. data/lib/chef/mixin/find_preferred_file.rb +3 -3
  92. data/lib/chef/mixin/language.rb +64 -23
  93. data/lib/chef/node.rb +27 -3
  94. data/lib/chef/node/attribute.rb +20 -10
  95. data/lib/chef/platform.rb +3 -9
  96. data/lib/chef/provider/cron.rb +1 -1
  97. data/lib/chef/provider/deploy.rb +4 -1
  98. data/lib/chef/provider/group.rb +1 -1
  99. data/lib/chef/provider/group/dscl.rb +2 -2
  100. data/lib/chef/provider/mount/mount.rb +6 -6
  101. data/lib/chef/provider/package/easy_install.rb +8 -7
  102. data/lib/chef/provider/package/pacman.rb +1 -1
  103. data/lib/chef/provider/package/rpm.rb +4 -4
  104. data/lib/chef/provider/package/solaris.rb +127 -0
  105. data/lib/chef/provider/package/yum.rb +51 -28
  106. data/lib/chef/provider/remote_directory.rb +5 -2
  107. data/lib/chef/provider/remote_file.rb +1 -1
  108. data/lib/chef/provider/ruby_block.rb +1 -0
  109. data/lib/chef/provider/script.rb +2 -2
  110. data/lib/chef/provider/service/debian.rb +40 -4
  111. data/lib/chef/provider/service/freebsd.rb +1 -1
  112. data/lib/chef/provider/service/upstart.rb +3 -10
  113. data/lib/chef/provider/user/dscl.rb +2 -2
  114. data/lib/chef/providers.rb +1 -0
  115. data/lib/chef/resource.rb +7 -8
  116. data/lib/chef/resource/service.rb +17 -0
  117. data/lib/chef/resource/solaris_package.rb +36 -0
  118. data/lib/chef/resource/yum_package.rb +11 -4
  119. data/lib/chef/rest/rest_request.rb +18 -1
  120. data/lib/chef/run_list/run_list_expansion.rb +4 -0
  121. data/lib/chef/run_list/run_list_item.rb +8 -1
  122. data/lib/chef/shef/ext.rb +1 -1
  123. data/lib/chef/shef/shef_session.rb +7 -3
  124. data/lib/chef/tasks/chef_repo.rake +1 -0
  125. data/lib/chef/version.rb +2 -1
  126. metadata +23 -8
  127. data/lib/chef/cache/file_cache_by_checksum.rb +0 -52
@@ -90,7 +90,7 @@ class Chef
90
90
  if ::File.exists?("/etc/rc.conf")
91
91
  read_rc_conf.each do |line|
92
92
  case line
93
- when /#{service_enable_variable_name}="(\w+)"/
93
+ when /#{Regexp.escape(service_enable_variable_name)}="(\w+)"/
94
94
  if $1 =~ /[Yy][Ee][Ss]/
95
95
  @current_resource.enabled true
96
96
  elsif $1 =~ /[Nn][Oo][Nn]?[Oo]?[Nn]?[Ee]?/
@@ -44,16 +44,9 @@ class Chef
44
44
  run_context.node
45
45
 
46
46
  platform, version = Chef::Platform.find_platform_and_version(run_context.node)
47
- case platform
48
- when "ubuntu"
49
- case version
50
- when /8.04/,/8.10/,/9.04/,/10.04/
51
- @upstart_job_dir = "/etc/event.d"
52
- @upstart_conf_suffix = ""
53
- else
54
- @upstart_job_dir = "/etc/init"
55
- @upstart_conf_suffix = ".conf"
56
- end
47
+ if platform == "ubuntu" && (8.04..9.04).include?(version.to_f)
48
+ @upstart_job_dir = "/etc/event.d"
49
+ @upstart_conf_suffix = ""
57
50
  else
58
51
  @upstart_job_dir = "/etc/init"
59
52
  @upstart_conf_suffix = ".conf"
@@ -52,7 +52,7 @@ class Chef
52
52
  uid = nil; next_uid_guess = 200
53
53
  users_uids = safe_dscl("list /Users uid")
54
54
  while(next_uid_guess < search_limit + 200)
55
- if users_uids =~ Regexp.new("#{next_uid_guess}\n")
55
+ if users_uids =~ Regexp.new("#{Regexp.escape(next_uid_guess.to_s)}\n")
56
56
  next_uid_guess += 1
57
57
  else
58
58
  uid = next_uid_guess
@@ -65,7 +65,7 @@ class Chef
65
65
  def uid_used?(uid)
66
66
  return false unless uid
67
67
  users_uids = safe_dscl("list /Users uid")
68
- !! ( users_uids =~ Regexp.new("#{uid}\n") )
68
+ !! ( users_uids =~ Regexp.new("#{Regexp.escape(uid.to_s)}\n") )
69
69
  end
70
70
 
71
71
  def set_uid
@@ -57,6 +57,7 @@ require 'chef/provider/package/rpm'
57
57
  require 'chef/provider/package/rubygems'
58
58
  require 'chef/provider/package/yum'
59
59
  require 'chef/provider/package/zypper'
60
+ require 'chef/provider/package/solaris'
60
61
 
61
62
  require 'chef/provider/service/arch'
62
63
  require 'chef/provider/service/debian'
@@ -28,7 +28,10 @@ require 'chef/mixin/deprecation'
28
28
 
29
29
  class Chef
30
30
  class Resource
31
- HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name]
31
+ class Notification < Struct.new(:resource, :action)
32
+ end
33
+
34
+ HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@node]
32
35
 
33
36
  include Chef::Mixin::CheckHelper
34
37
  include Chef::Mixin::ParamsValidate
@@ -211,12 +214,10 @@ class Chef
211
214
  end
212
215
 
213
216
  def to_text
214
- skip =
215
217
  ivars = instance_variables.map { |ivar| ivar.to_sym } - HIDDEN_IVARS
216
218
  text = "# Declared in #{@source_line}\n"
217
- text << convert_to_snake_case(self.class.name, 'Chef::Resource') + "(#{name}) do\n"
219
+ text << convert_to_snake_case(self.class.name, 'Chef::Resource') + "(\"#{name}\") do\n"
218
220
  ivars.each do |ivar|
219
- #next if skip.include?(ivar)
220
221
  if (value = instance_variable_get(ivar)) && !(value.respond_to?(:empty?) && value.empty?)
221
222
  text << " #{ivar.to_s.sub(/^@/,'')}(#{value.inspect})\n"
222
223
  end
@@ -242,8 +243,6 @@ class Chef
242
243
  def to_hash
243
244
  instance_vars = Hash.new
244
245
  self.instance_variables.each do |iv|
245
- #iv = iv.to_s
246
- #next if iv == "@run_context"
247
246
  key = iv.to_s.sub(/^@/,'').to_sym
248
247
  instance_vars[key] = self.instance_variable_get(iv) unless (key == :run_context) || (key == :node)
249
248
  end
@@ -385,7 +384,7 @@ class Chef
385
384
  begin
386
385
  self.class.provider_base.const_get(convert_to_class_name(name.to_s))
387
386
  rescue NameError => e
388
- if e.to_s =~ /#{self.class.provider_base.to_s}/
387
+ if e.to_s =~ /#{Regexp.escape(self.class.provider_base.to_s)}/
389
388
  raise ArgumentError, "No provider found to match '#{name}'"
390
389
  else
391
390
  raise e
@@ -404,7 +403,7 @@ class Chef
404
403
 
405
404
  resource_array = [resources].flatten
406
405
  resource_array.each do |resource|
407
- new_notify = OpenStruct.new(:resource => resource, :action => action)
406
+ new_notify = Notification.new(resource, action)
408
407
  if timing == :delayed
409
408
  notifies_delayed << new_notify
410
409
  else
@@ -34,6 +34,7 @@ class Chef
34
34
  @status_command = nil
35
35
  @restart_command = nil
36
36
  @reload_command = nil
37
+ @priority = nil
37
38
  @action = "nothing"
38
39
  @startup_type = :automatic
39
40
  @supports = { :restart => false, :reload => false, :status => false }
@@ -119,6 +120,22 @@ class Chef
119
120
  )
120
121
  end
121
122
 
123
+ # Priority arguments can have two forms:
124
+ #
125
+ # - a simple number, in which the default start runlevels get
126
+ # that as the start value and stop runlevels get 100 - value.
127
+ #
128
+ # - a hash like { 2 => [:start, 20], 3 => [:stop, 55] }, where
129
+ # the service will be marked as started with priority 20 in
130
+ # runlevel 2, stopped in 3 with priority 55 and no symlinks or
131
+ # similar for other runlevels
132
+ #
133
+ def priority(arg=nil)
134
+ set_or_return(:priority,
135
+ arg,
136
+ :kind_of => [ Integer, String, Hash ])
137
+ end
138
+
122
139
  def supports(args={})
123
140
  if args.is_a? Array
124
141
  args.each { |arg| @supports[arg] = true }
@@ -0,0 +1,36 @@
1
+ #
2
+ # Author:: Toomas Pelberg (<toomasp@gmx.net>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'chef/resource/package'
20
+ require 'chef/provider/package/solaris'
21
+
22
+ class Chef
23
+ class Resource
24
+ class SolarisPackage < Chef::Resource::Package
25
+
26
+ def initialize(name, collection=nil, node=nil)
27
+ super(name, collection, node)
28
+ @resource_name = :solaris_package
29
+ @provider = Chef::Provider::Package::Solaris
30
+ end
31
+
32
+ end
33
+ end
34
+ end
35
+
36
+
@@ -22,15 +22,22 @@ require 'chef/provider/package/yum'
22
22
  class Chef
23
23
  class Resource
24
24
  class YumPackage < Chef::Resource::Package
25
-
25
+
26
26
  def initialize(name, run_context=nil)
27
27
  super
28
28
  @resource_name = :yum_package
29
29
  @provider = Chef::Provider::Package::Yum
30
30
  end
31
-
31
+
32
+ # Install a specific arch
33
+ def arch(arg=nil)
34
+ set_or_return(
35
+ :arch,
36
+ arg,
37
+ :kind_of => [ String ]
38
+ )
39
+ end
40
+
32
41
  end
33
42
  end
34
43
  end
35
-
36
-
@@ -103,8 +103,25 @@ class Chef
103
103
  end
104
104
  end
105
105
 
106
+ #adapted from buildr/lib/buildr/core/transports.rb
107
+ def proxy_uri
108
+ proxy = Chef::Config["#{url.scheme}_proxy"]
109
+ proxy = URI.parse(proxy) if String === proxy
110
+ excludes = Chef::Config[:no_proxy].to_s.split(/\s*,\s*/).compact
111
+ excludes = excludes.map { |exclude| exclude =~ /:\d+$/ ? exclude : "#{exclude}:*" }
112
+ return proxy unless excludes.any? { |exclude| File.fnmatch(exclude, "#{host}:#{port}") }
113
+ end
114
+
106
115
  def configure_http_client
107
- @http_client = Net::HTTP.new(host, port)
116
+ http_proxy = proxy_uri
117
+ if http_proxy.nil?
118
+ @http_client = Net::HTTP.new(host, port)
119
+ else
120
+ Chef::Log.debug("using #{http_proxy.host}:#{http_proxy.port} for proxy")
121
+ user = Chef::Config["#{url.scheme}_proxy_user"]
122
+ pass = Chef::Config["#{url.scheme}_proxy_pass"]
123
+ @http_client = Net::HTTP.Proxy(http_proxy.host, http_proxy.port, user, pass).new(host, port)
124
+ end
108
125
  if url.scheme == "https"
109
126
  @http_client.use_ssl = true
110
127
  if config[:ssl_verify_mode] == :verify_none
@@ -105,6 +105,10 @@ class Chef
105
105
  @applied_roles[role_name] = true
106
106
  end
107
107
 
108
+ def roles
109
+ @applied_roles.keys
110
+ end
111
+
108
112
  # In subclasses, this method will fetch the role from the data source.
109
113
  def fetch_role(name)
110
114
  raise NotImplementedError
@@ -28,7 +28,7 @@ class Chef
28
28
  def initialize(item)
29
29
  case item
30
30
  when Hash
31
- raise ArgumentError, "Initializing a #{self.class} from a hash requires that it have a 'type' and 'name' key" unless (item.has_key?('type')||item.has_key?(:type)) && (item.has_key?('name')||item.has_key?(:name))
31
+ assert_hash_is_valid_run_list_item!(item)
32
32
  @type = (item['type'] || item[:type]).to_sym
33
33
  @name = item['name'] || item[:name]
34
34
  when String
@@ -66,6 +66,13 @@ class Chef
66
66
  other.respond_to?(:type) && other.respond_to?(:name) && other.type == @type && other.name == @name
67
67
  end
68
68
  end
69
+
70
+ def assert_hash_is_valid_run_list_item!(item)
71
+ unless (item.key?('type')|| item.key?(:type)) && (item.key?('name') || item.key?(:name))
72
+ raise ArgumentError, "Initializing a #{self.class} from a hash requires that it have a 'type' and 'name' key"
73
+ end
74
+ end
75
+
69
76
  end
70
77
  end
71
78
  end
@@ -241,7 +241,7 @@ class Object
241
241
  :skip_back => "move back in the run list",
242
242
  :skip_forward => "move forward in the run list"
243
243
  def chef_run
244
- Shef.session.collection.iterator
244
+ Shef.session.resource_collection.iterator
245
245
  end
246
246
 
247
247
  desc "resets the current recipe"
@@ -15,6 +15,13 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
+ require 'chef/recipe'
19
+ require 'chef/run_context'
20
+ require 'chef/config'
21
+ require 'chef/client'
22
+ require 'chef/cookbook/cookbook_collection'
23
+ require 'chef/cookbook_loader'
24
+
18
25
  module Shef
19
26
  class ShefSession
20
27
  include Singleton
@@ -126,7 +133,6 @@ module Shef
126
133
  Chef::Config[:solo] = true
127
134
  @client = Chef::Client.new
128
135
  @client.run_ohai
129
- @client.determine_node_name
130
136
  @client.build_node #(@client.node_name, true)
131
137
  end
132
138
 
@@ -149,7 +155,6 @@ module Shef
149
155
  Chef::Config[:solo] = true
150
156
  @client = Chef::Client.new
151
157
  @client.run_ohai
152
- @client.determine_node_name
153
158
  @client.build_node #(@client.node_name, true)
154
159
  end
155
160
 
@@ -168,7 +173,6 @@ module Shef
168
173
  Chef::Config[:solo] = false
169
174
  @client = Chef::Client.new
170
175
  @client.run_ohai
171
- @client.determine_node_name
172
176
  @client.register
173
177
  @client.build_node #(@client.node_name, false)
174
178
 
@@ -77,6 +77,7 @@ task :default => [ :test_cookbooks ]
77
77
 
78
78
  desc "Create a new cookbook (with COOKBOOK=name, optional CB_PREFIX=site-)"
79
79
  task :new_cookbook do
80
+ puts "***WARN: rake new_cookbook is deprecated. Please use 'knife cookbook new COOKBOOK' command.***"
80
81
  create_cookbook(File.join(TOPDIR, "#{ENV["CB_PREFIX"]}cookbooks"))
81
82
  create_readme(File.join(TOPDIR, "#{ENV["CB_PREFIX"]}cookbooks"))
82
83
  create_metadata(File.join(TOPDIR, "#{ENV["CB_PREFIX"]}cookbooks"))
@@ -16,5 +16,6 @@
16
16
  # limitations under the License.
17
17
 
18
18
  class Chef
19
- VERSION = '0.9.6'
19
+ CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
+ VERSION = '0.9.8.beta.1'
20
21
  end
metadata CHANGED
@@ -1,12 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ prerelease: true
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 6
9
- version: 0.9.6
8
+ - 8
9
+ - beta
10
+ - 1
11
+ version: 0.9.8.beta.1
10
12
  platform: ruby
11
13
  authors:
12
14
  - Adam Jacob
@@ -14,7 +16,7 @@ autorequire:
14
16
  bindir: bin
15
17
  cert_chain: []
16
18
 
17
- date: 2010-07-02 00:00:00 -07:00
19
+ date: 2010-07-23 00:00:00 -07:00
18
20
  default_executable:
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
@@ -275,7 +277,6 @@ files:
275
277
  - lib/chef/application.rb
276
278
  - lib/chef/applications.rb
277
279
  - lib/chef/cache/checksum.rb
278
- - lib/chef/cache/file_cache_by_checksum.rb
279
280
  - lib/chef/cache.rb
280
281
  - lib/chef/certificate.rb
281
282
  - lib/chef/checksum.rb
@@ -289,6 +290,8 @@ files:
289
290
  - lib/chef/cookbook/remote_file_vendor.rb
290
291
  - lib/chef/cookbook/syntax_check.rb
291
292
  - lib/chef/cookbook_loader.rb
293
+ - lib/chef/cookbook_site_streaming_uploader.rb
294
+ - lib/chef/cookbook_uploader.rb
292
295
  - lib/chef/cookbook_version.rb
293
296
  - lib/chef/couchdb.rb
294
297
  - lib/chef/daemon.rb
@@ -303,6 +306,9 @@ files:
303
306
  - lib/chef/index_queue/consumer.rb
304
307
  - lib/chef/index_queue/indexable.rb
305
308
  - lib/chef/index_queue.rb
309
+ - lib/chef/knife/bootstrap/centos5-gems.erb
310
+ - lib/chef/knife/bootstrap/fedora13-gems.erb
311
+ - lib/chef/knife/bootstrap/ubuntu10.04-gems.erb
306
312
  - lib/chef/knife/bootstrap.rb
307
313
  - lib/chef/knife/client_bulk_delete.rb
308
314
  - lib/chef/knife/client_create.rb
@@ -314,6 +320,7 @@ files:
314
320
  - lib/chef/knife/configure.rb
315
321
  - lib/chef/knife/configure_client.rb
316
322
  - lib/chef/knife/cookbook_bulk_delete.rb
323
+ - lib/chef/knife/cookbook_create.rb
317
324
  - lib/chef/knife/cookbook_delete.rb
318
325
  - lib/chef/knife/cookbook_download.rb
319
326
  - lib/chef/knife/cookbook_list.rb
@@ -323,7 +330,9 @@ files:
323
330
  - lib/chef/knife/cookbook_site_download.rb
324
331
  - lib/chef/knife/cookbook_site_list.rb
325
332
  - lib/chef/knife/cookbook_site_search.rb
333
+ - lib/chef/knife/cookbook_site_share.rb
326
334
  - lib/chef/knife/cookbook_site_show.rb
335
+ - lib/chef/knife/cookbook_site_unshare.rb
327
336
  - lib/chef/knife/cookbook_site_vendor.rb
328
337
  - lib/chef/knife/cookbook_test.rb
329
338
  - lib/chef/knife/cookbook_upload.rb
@@ -372,6 +381,8 @@ files:
372
381
  - lib/chef/log.rb
373
382
  - lib/chef/mixin/check_helper.rb
374
383
  - lib/chef/mixin/checksum.rb
384
+ - lib/chef/mixin/command/unix.rb
385
+ - lib/chef/mixin/command/windows.rb
375
386
  - lib/chef/mixin/command.rb
376
387
  - lib/chef/mixin/convert_to_class_name.rb
377
388
  - lib/chef/mixin/create_path.rb
@@ -432,6 +443,7 @@ files:
432
443
  - lib/chef/provider/package/portage.rb
433
444
  - lib/chef/provider/package/rpm.rb
434
445
  - lib/chef/provider/package/rubygems.rb
446
+ - lib/chef/provider/package/solaris.rb
435
447
  - lib/chef/provider/package/yum-dump.py
436
448
  - lib/chef/provider/package/yum.rb
437
449
  - lib/chef/provider/package/zypper.rb
@@ -501,6 +513,7 @@ files:
501
513
  - lib/chef/resource/scm.rb
502
514
  - lib/chef/resource/script.rb
503
515
  - lib/chef/resource/service.rb
516
+ - lib/chef/resource/solaris_package.rb
504
517
  - lib/chef/resource/subversion.rb
505
518
  - lib/chef/resource/template.rb
506
519
  - lib/chef/resource/timestamped_deploy.rb
@@ -564,11 +577,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
564
577
  required_rubygems_version: !ruby/object:Gem::Requirement
565
578
  none: false
566
579
  requirements:
567
- - - ">="
580
+ - - ">"
568
581
  - !ruby/object:Gem::Version
569
582
  segments:
570
- - 0
571
- version: "0"
583
+ - 1
584
+ - 3
585
+ - 1
586
+ version: 1.3.1
572
587
  requirements: []
573
588
 
574
589
  rubyforge_project:
@@ -1,52 +0,0 @@
1
- #
2
- # Author:: Tim Hinderliter (<tim@opscode.com>)
3
- # Author:: Christopher Walters (<cw@opscode.com>)
4
- # Copyright:: Copyright (c) 2010 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- class Chef
21
- class Cache
22
- class FileCacheByChecksum
23
- attr_reader :basedir
24
-
25
- def initialize(basedir = Chef::Config[:file_cache_path])
26
- @basedir = basedir
27
- end
28
-
29
- # returns path
30
- def get_path(checksum)
31
- path = checksum_path(checksum)
32
-
33
- File.exists?(path) ? path : nil
34
- end
35
-
36
- # path = path to tempfile as input
37
- # returns destination path
38
- def put(checksum, src_path)
39
- dest_path = checksum_path(checksum)
40
- FileUtils.mkdir_p(File.dirname(dest_path))
41
-
42
- FileUtils.cp(src_path, dest_path)
43
-
44
- dest_path
45
- end
46
-
47
- def checksum_path(checksum)
48
- File.join(basedir, checksum[0..1], checksum)
49
- end
50
- end
51
- end
52
- end