chef 0.9.8 → 0.9.10.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/distro/common/man/man8/knife.8 +89 -79
- data/distro/common/markdown/knife.mkd +7 -0
- data/distro/debian/etc/default/chef-server +3 -0
- data/distro/debian/etc/default/chef-server-webui +3 -0
- data/distro/debian/etc/default/chef-solr +3 -0
- data/distro/debian/etc/default/chef-solr-indexer +3 -0
- data/distro/debian/etc/init.d/chef-server +3 -1
- data/distro/debian/etc/init.d/chef-server-webui +3 -1
- data/distro/redhat/etc/init.d/chef-client +1 -1
- data/lib/chef/application.rb +2 -0
- data/lib/chef/application/client.rb +5 -3
- data/lib/chef/application/knife.rb +16 -5
- data/lib/chef/application/solo.rb +0 -1
- data/lib/chef/checksum.rb +65 -1
- data/lib/chef/checksum_cache.rb +173 -0
- data/lib/chef/client.rb +84 -121
- data/lib/chef/cookbook/remote_file_vendor.rb +10 -3
- data/lib/chef/cookbook/syntax_check.rb +2 -2
- data/lib/chef/cookbook_loader.rb +2 -0
- data/lib/chef/cookbook_site_streaming_uploader.rb +29 -0
- data/lib/chef/cookbook_uploader.rb +8 -7
- data/lib/chef/cookbook_version.rb +155 -114
- data/lib/chef/exceptions.rb +5 -0
- data/lib/chef/handler.rb +43 -0
- data/lib/chef/index_queue/consumer.rb +1 -1
- data/lib/chef/index_queue/indexable.rb +1 -1
- data/lib/chef/knife.rb +18 -5
- data/lib/chef/knife/bootstrap.rb +2 -2
- data/lib/chef/knife/bootstrap/archlinux-gems.erb +44 -0
- data/lib/chef/knife/bootstrap/client-install.vbs +80 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +2 -2
- data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +6 -7
- data/lib/chef/knife/bootstrap/windows-gems.erb +34 -0
- data/lib/chef/knife/configure_client.rb +4 -2
- data/lib/chef/knife/cookbook_metadata.rb +1 -1
- data/lib/chef/knife/cookbook_site_share.rb +2 -1
- data/lib/chef/knife/cookbook_site_vendor.rb +6 -0
- data/lib/chef/knife/cookbook_test.rb +1 -1
- data/lib/chef/knife/ec2_server_create.rb +51 -26
- data/lib/chef/knife/exec.rb +52 -0
- data/lib/chef/knife/ssh.rb +27 -15
- data/lib/chef/knife/status.rb +27 -10
- data/lib/chef/knife/windows_bootstrap.rb +154 -0
- data/lib/chef/mixin/checksum.rb +2 -2
- data/lib/chef/mixin/xml_escape.rb +75 -49
- data/lib/chef/node.rb +54 -58
- data/lib/chef/node/attribute.rb +61 -53
- data/lib/chef/platform.rb +19 -2
- data/lib/chef/provider/breakpoint.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +3 -3
- data/lib/chef/provider/cron.rb +3 -3
- data/lib/chef/provider/cron/solaris.rb +195 -0
- data/lib/chef/provider/deploy.rb +3 -3
- data/lib/chef/provider/directory.rb +2 -2
- data/lib/chef/provider/env.rb +5 -5
- data/lib/chef/provider/execute.rb +1 -1
- data/lib/chef/provider/file.rb +10 -9
- data/lib/chef/provider/git.rb +12 -4
- data/lib/chef/provider/group.rb +5 -5
- data/lib/chef/provider/http_request.rb +25 -9
- data/lib/chef/provider/ifconfig.rb +2 -2
- data/lib/chef/provider/link.rb +11 -6
- data/lib/chef/provider/log.rb +1 -0
- data/lib/chef/provider/mdadm.rb +3 -3
- data/lib/chef/provider/mount.rb +5 -5
- data/lib/chef/provider/mount/mount.rb +1 -1
- data/lib/chef/provider/ohai.rb +41 -0
- data/lib/chef/provider/package.rb +5 -5
- data/lib/chef/provider/package/yum-dump.py +5 -2
- data/lib/chef/provider/remote_directory.rb +11 -5
- data/lib/chef/provider/remote_file.rb +2 -2
- data/lib/chef/provider/route.rb +154 -133
- data/lib/chef/provider/ruby_block.rb +1 -1
- data/lib/chef/provider/service.rb +6 -6
- data/lib/chef/provider/subversion.rb +12 -9
- data/lib/chef/provider/template.rb +2 -2
- data/lib/chef/provider/user.rb +7 -7
- data/lib/chef/provider/user/useradd.rb +15 -1
- data/lib/chef/providers.rb +2 -0
- data/lib/chef/resource.rb +164 -58
- data/lib/chef/resource/http_request.rb +9 -0
- data/lib/chef/resource/ohai.rb +40 -0
- data/lib/chef/resource/remote_directory.rb +10 -1
- data/lib/chef/resource/rpm_package.rb +34 -0
- data/lib/chef/resource_collection.rb +3 -2
- data/lib/chef/resources.rb +2 -0
- data/lib/chef/rest.rb +13 -7
- data/lib/chef/rest/auth_credentials.rb +1 -1
- data/lib/chef/rest/rest_request.rb +3 -1
- data/lib/chef/runner.rb +31 -55
- data/lib/chef/shef/shef_session.rb +1 -1
- data/lib/chef/util/windows/net_use.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/webui_user.rb +0 -1
- metadata +38 -19
- data/lib/chef/cache.rb +0 -61
- data/lib/chef/cache/checksum.rb +0 -91
data/lib/chef/provider/deploy.rb
CHANGED
@@ -68,7 +68,7 @@ class Chef
|
|
68
68
|
end
|
69
69
|
else
|
70
70
|
deploy
|
71
|
-
@new_resource.
|
71
|
+
@new_resource.updated_by_last_action(true)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -78,7 +78,7 @@ class Chef
|
|
78
78
|
FileUtils.rm_rf(release_path)
|
79
79
|
end
|
80
80
|
deploy
|
81
|
-
@new_resource.
|
81
|
+
@new_resource.updated_by_last_action(true)
|
82
82
|
end
|
83
83
|
|
84
84
|
def action_rollback
|
@@ -102,7 +102,7 @@ class Chef
|
|
102
102
|
FileUtils.rm_rf i
|
103
103
|
release_deleted(i)
|
104
104
|
end
|
105
|
-
@new_resource.
|
105
|
+
@new_resource.updated_by_last_action(true)
|
106
106
|
end
|
107
107
|
|
108
108
|
def deploy
|
@@ -46,7 +46,7 @@ class Chef
|
|
46
46
|
else
|
47
47
|
::Dir.mkdir(@new_resource.path)
|
48
48
|
end
|
49
|
-
@new_resource.
|
49
|
+
@new_resource.updated_by_last_action(true)
|
50
50
|
end
|
51
51
|
set_owner if @new_resource.owner != nil
|
52
52
|
set_group if @new_resource.group != nil
|
@@ -62,7 +62,7 @@ class Chef
|
|
62
62
|
Chef::Log.info("Deleting #{@new_resource} at #{@new_resource.path}")
|
63
63
|
::Dir.delete(@new_resource.path)
|
64
64
|
end
|
65
|
-
@new_resource.
|
65
|
+
@new_resource.updated_by_last_action(true)
|
66
66
|
else
|
67
67
|
raise RuntimeError, "Cannot delete #{@new_resource} at #{@new_resource_path}!" if ::File.exists?(@new_resource.path)
|
68
68
|
end
|
data/lib/chef/provider/env.rb
CHANGED
@@ -74,12 +74,12 @@ class Chef
|
|
74
74
|
if compare_value
|
75
75
|
modify_env
|
76
76
|
Chef::Log.info("Altered #{@new_resource}")
|
77
|
-
@new_resource.
|
77
|
+
@new_resource.updated_by_last_action(true)
|
78
78
|
end
|
79
79
|
else
|
80
80
|
create_env
|
81
81
|
Chef::Log.debug("Created #{@new_resource}")
|
82
|
-
@new_resource.
|
82
|
+
@new_resource.updated_by_last_action(true)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -106,7 +106,7 @@ class Chef
|
|
106
106
|
old_value = @new_resource.value(new_value)
|
107
107
|
create_env
|
108
108
|
Chef::Log.debug("Deleted #{old_value} element")
|
109
|
-
@new_resource.
|
109
|
+
@new_resource.updated_by_last_action(true)
|
110
110
|
return true #we removed the element and updated; do not delete the key
|
111
111
|
end
|
112
112
|
end
|
@@ -116,7 +116,7 @@ class Chef
|
|
116
116
|
if @key_exists && !delete_element
|
117
117
|
delete_env
|
118
118
|
Chef::Log.debug("Deleted #{@new_resource}")
|
119
|
-
@new_resource.
|
119
|
+
@new_resource.updated_by_last_action(true)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -124,7 +124,7 @@ class Chef
|
|
124
124
|
if @key_exists
|
125
125
|
if compare_value
|
126
126
|
modify_env
|
127
|
-
@new_resource.
|
127
|
+
@new_resource.updated_by_last_action(true)
|
128
128
|
Chef::Log.info("Modified #{@new_resource}")
|
129
129
|
end
|
130
130
|
else
|
data/lib/chef/provider/file.rb
CHANGED
@@ -66,7 +66,7 @@ class Chef
|
|
66
66
|
Chef::Log.info("Setting content for #{@new_resource}")
|
67
67
|
backup @new_resource.path if ::File.exists?(@new_resource.path)
|
68
68
|
::File.open(@new_resource.path, "w") {|f| f.write @new_resource.content }
|
69
|
-
@new_resource.
|
69
|
+
@new_resource.updated_by_last_action(true)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -91,7 +91,7 @@ class Chef
|
|
91
91
|
Chef::Log.info("Setting owner to #{@set_user_id} for #{@new_resource}")
|
92
92
|
@set_user_id = negative_complement(@set_user_id)
|
93
93
|
::File.chown(@set_user_id, nil, @new_resource.path)
|
94
|
-
@new_resource.
|
94
|
+
@new_resource.updated_by_last_action(true)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -114,7 +114,7 @@ class Chef
|
|
114
114
|
Chef::Log.info("Setting group to #{@set_group_id} for #{@new_resource}")
|
115
115
|
@set_group_id = negative_complement(@set_group_id)
|
116
116
|
::File.chown(nil, @set_group_id, @new_resource.path)
|
117
|
-
@new_resource.
|
117
|
+
@new_resource.updated_by_last_action(true)
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -132,17 +132,18 @@ class Chef
|
|
132
132
|
Chef::Log.info("Setting mode to #{sprintf("%o" % octal_mode(@new_resource.mode))} for #{@new_resource}")
|
133
133
|
# CHEF-174, bad mojo around treating integers as octal. If a string is passed, we try to do the "right" thing
|
134
134
|
::File.chmod(octal_mode(@new_resource.mode), @new_resource.path)
|
135
|
-
@new_resource.
|
135
|
+
@new_resource.updated_by_last_action(true)
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
139
|
def action_create
|
140
140
|
unless ::File.exists?(@new_resource.path)
|
141
141
|
Chef::Log.info("Creating #{@new_resource} at #{@new_resource.path}")
|
142
|
-
::File.open(@new_resource.path, "w+") {
|
143
|
-
@new_resource.
|
142
|
+
::File.open(@new_resource.path, "w+") {|f| f.write @new_resource.content }
|
143
|
+
@new_resource.updated_by_last_action(true)
|
144
|
+
else
|
145
|
+
set_content unless @new_resource.content.nil?
|
144
146
|
end
|
145
|
-
set_content unless @new_resource.content.nil?
|
146
147
|
set_owner unless @new_resource.owner.nil?
|
147
148
|
set_group unless @new_resource.group.nil?
|
148
149
|
set_mode unless @new_resource.mode.nil?
|
@@ -158,7 +159,7 @@ class Chef
|
|
158
159
|
backup unless ::File.symlink?(@new_resource.path)
|
159
160
|
Chef::Log.info("Deleting #{@new_resource} at #{@new_resource.path}")
|
160
161
|
::File.delete(@new_resource.path)
|
161
|
-
@new_resource.
|
162
|
+
@new_resource.updated_by_last_action(true)
|
162
163
|
else
|
163
164
|
raise "Cannot delete #{@new_resource} at #{@new_resource_path}!"
|
164
165
|
end
|
@@ -170,7 +171,7 @@ class Chef
|
|
170
171
|
time = Time.now
|
171
172
|
Chef::Log.info("Updating #{@new_resource} with new atime/mtime of #{time}")
|
172
173
|
::File.utime(time, time, @new_resource.path)
|
173
|
-
@new_resource.
|
174
|
+
@new_resource.updated_by_last_action(true)
|
174
175
|
end
|
175
176
|
|
176
177
|
def backup(file=nil)
|
data/lib/chef/provider/git.rb
CHANGED
@@ -40,7 +40,7 @@ class Chef
|
|
40
40
|
clone
|
41
41
|
checkout
|
42
42
|
enable_submodules
|
43
|
-
@new_resource.
|
43
|
+
@new_resource.updated_by_last_action(true)
|
44
44
|
else
|
45
45
|
Chef::Log.info "Taking no action, checkout destination #{@new_resource.destination} already exists or is a non-empty directory"
|
46
46
|
end
|
@@ -49,18 +49,26 @@ class Chef
|
|
49
49
|
def action_export
|
50
50
|
action_checkout
|
51
51
|
FileUtils.rm_rf(::File.join(@new_resource.destination,".git"))
|
52
|
-
@new_resource.
|
52
|
+
@new_resource.updated_by_last_action(true)
|
53
53
|
end
|
54
54
|
|
55
55
|
def action_sync
|
56
56
|
if !::File.exist?(@new_resource.destination) || Dir.entries(@new_resource.destination) == ['.','..']
|
57
57
|
action_checkout
|
58
|
+
@new_resource.updated_by_last_action(true)
|
58
59
|
else
|
60
|
+
current_rev = find_current_revision
|
61
|
+
Chef::Log.debug "#{@new_resource} revision: #{current_rev}"
|
59
62
|
sync
|
60
63
|
enable_submodules
|
64
|
+
new_rev = find_current_revision
|
65
|
+
if current_rev == new_rev
|
66
|
+
@new_resource.updated_by_last_action(false)
|
67
|
+
else
|
68
|
+
Chef::Log.info "#{@new_resource} updated revision is: #{new_rev}"
|
69
|
+
@new_resource.updated_by_last_action(true)
|
70
|
+
end
|
61
71
|
end
|
62
|
-
|
63
|
-
@new_resource.updated = true
|
64
72
|
end
|
65
73
|
|
66
74
|
def find_current_revision
|
data/lib/chef/provider/group.rb
CHANGED
@@ -78,12 +78,12 @@ class Chef
|
|
78
78
|
when false
|
79
79
|
create_group
|
80
80
|
Chef::Log.info("Created #{@new_resource}")
|
81
|
-
@new_resource.
|
81
|
+
@new_resource.updated_by_last_action(true)
|
82
82
|
else
|
83
83
|
if compare_group
|
84
84
|
manage_group
|
85
85
|
Chef::Log.info("Altered #{@new_resource}")
|
86
|
-
@new_resource.
|
86
|
+
@new_resource.updated_by_last_action(true)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -91,7 +91,7 @@ class Chef
|
|
91
91
|
def action_remove
|
92
92
|
if @group_exists
|
93
93
|
remove_group
|
94
|
-
@new_resource.
|
94
|
+
@new_resource.updated_by_last_action(true)
|
95
95
|
Chef::Log.info("Removed #{@new_resource}")
|
96
96
|
end
|
97
97
|
end
|
@@ -99,7 +99,7 @@ class Chef
|
|
99
99
|
def action_manage
|
100
100
|
if @group_exists && compare_group
|
101
101
|
manage_group
|
102
|
-
@new_resource.
|
102
|
+
@new_resource.updated_by_last_action(true)
|
103
103
|
Chef::Log.info("Managed #{@new_resource}")
|
104
104
|
end
|
105
105
|
end
|
@@ -108,7 +108,7 @@ class Chef
|
|
108
108
|
if @group_exists
|
109
109
|
if compare_group
|
110
110
|
manage_group
|
111
|
-
@new_resource.
|
111
|
+
@new_resource.updated_by_last_action(true)
|
112
112
|
Chef::Log.info("Modified #{@new_resource}")
|
113
113
|
end
|
114
114
|
else
|
@@ -27,19 +27,35 @@ class Chef
|
|
27
27
|
def load_current_resource
|
28
28
|
@rest = Chef::REST.new(@new_resource.url, nil, nil)
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
# Send a HEAD request to @new_resource.url, with ?message=@new_resource.message
|
32
|
+
def action_head
|
33
|
+
message = check_message(@new_resource.message)
|
34
|
+
modified = @rest.run_request(
|
35
|
+
:HEAD,
|
36
|
+
@rest.create_url("#{@new_resource.url}?message=#{message}"),
|
37
|
+
@new_resource.headers,
|
38
|
+
false,
|
39
|
+
10,
|
40
|
+
false
|
41
|
+
)
|
42
|
+
@new_resource.updated_by_last_action(modified)
|
43
|
+
Chef::Log.info("#{@new_resource} HEAD to #{@new_resource.url} successful")
|
44
|
+
Chef::Log.debug("#{@new_resource} HEAD request response: #{modified}")
|
45
|
+
end
|
46
|
+
|
31
47
|
# Send a GET request to @new_resource.url, with ?message=@new_resource.message
|
32
48
|
def action_get
|
33
49
|
message = check_message(@new_resource.message)
|
34
50
|
body = @rest.run_request(
|
35
51
|
:GET,
|
36
52
|
@rest.create_url("#{@new_resource.url}?message=#{message}"),
|
37
|
-
|
53
|
+
@new_resource.headers,
|
38
54
|
false,
|
39
55
|
10,
|
40
56
|
false
|
41
57
|
)
|
42
|
-
@new_resource.
|
58
|
+
@new_resource.updated_by_last_action(true)
|
43
59
|
Chef::Log.info("#{@new_resource} GET to #{@new_resource.url} successful")
|
44
60
|
Chef::Log.debug("#{@new_resource} GET request response: #{body}")
|
45
61
|
end
|
@@ -50,12 +66,12 @@ class Chef
|
|
50
66
|
body = @rest.run_request(
|
51
67
|
:PUT,
|
52
68
|
@rest.create_url("#{@new_resource.url}"),
|
53
|
-
|
69
|
+
@new_resource.headers,
|
54
70
|
message,
|
55
71
|
10,
|
56
72
|
false
|
57
73
|
)
|
58
|
-
@new_resource.
|
74
|
+
@new_resource.updated_by_last_action(true)
|
59
75
|
Chef::Log.info("#{@new_resource} PUT to #{@new_resource.url} successful")
|
60
76
|
Chef::Log.debug("#{@new_resource} PUT request response: #{body}")
|
61
77
|
end
|
@@ -66,12 +82,12 @@ class Chef
|
|
66
82
|
body = @rest.run_request(
|
67
83
|
:POST,
|
68
84
|
@rest.create_url("#{@new_resource.url}"),
|
69
|
-
|
85
|
+
@new_resource.headers,
|
70
86
|
message,
|
71
87
|
10,
|
72
88
|
false
|
73
89
|
)
|
74
|
-
@new_resource.
|
90
|
+
@new_resource.updated_by_last_action(true)
|
75
91
|
Chef::Log.info("#{@new_resource} POST to #{@new_resource.url} message: #{message.inspect} successful")
|
76
92
|
Chef::Log.debug("#{@new_resource} POST request response: #{body}")
|
77
93
|
end
|
@@ -81,12 +97,12 @@ class Chef
|
|
81
97
|
body = @rest.run_request(
|
82
98
|
:DELETE,
|
83
99
|
@rest.create_url("#{@new_resource.url}"),
|
84
|
-
|
100
|
+
@new_resource.headers,
|
85
101
|
false,
|
86
102
|
10,
|
87
103
|
false
|
88
104
|
)
|
89
|
-
@new_resource.
|
105
|
+
@new_resource.updated_by_last_action(true)
|
90
106
|
Chef::Log.info("#{@new_resource} DELETE to #{@new_resource.url} successful")
|
91
107
|
Chef::Log.debug("#{@new_resource} DELETE request response: #{body}")
|
92
108
|
end
|
@@ -80,7 +80,7 @@ class Chef
|
|
80
80
|
run_command(
|
81
81
|
:command => command
|
82
82
|
)
|
83
|
-
@new_resource.
|
83
|
+
@new_resource.updated_by_last_action(true)
|
84
84
|
|
85
85
|
end
|
86
86
|
|
@@ -96,7 +96,7 @@ class Chef
|
|
96
96
|
run_command(
|
97
97
|
:command => command
|
98
98
|
)
|
99
|
-
@new_resource.
|
99
|
+
@new_resource.updated_by_last_action(true)
|
100
100
|
else
|
101
101
|
Chef::Log.debug("Ifconfig #{@current_resource} does not exist")
|
102
102
|
end
|
data/lib/chef/provider/link.rb
CHANGED
@@ -87,7 +87,7 @@ class Chef
|
|
87
87
|
Chef::Log.info("Setting owner to #{@set_user_id} for #{@new_resource}")
|
88
88
|
@set_user_id = negative_complement(@set_user_id)
|
89
89
|
::File.lchown(@set_user_id, nil, @new_resource.target_file)
|
90
|
-
@new_resource.
|
90
|
+
@new_resource.updated_by_last_action(true)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
@@ -110,7 +110,7 @@ class Chef
|
|
110
110
|
Chef::Log.info("Setting group to #{@set_group_id} for #{@new_resource}")
|
111
111
|
@set_group_id = negative_complement(@set_group_id)
|
112
112
|
::File.lchown(nil, @set_group_id, @new_resource.target_file)
|
113
|
-
@new_resource.
|
113
|
+
@new_resource.updated_by_last_action(true)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
@@ -118,11 +118,16 @@ class Chef
|
|
118
118
|
if @current_resource.to != ::File.expand_path(@new_resource.to, @new_resource.target_file)
|
119
119
|
Chef::Log.info("Creating a #{@new_resource.link_type} link from #{@new_resource.to} -> #{@new_resource.target_file} for #{@new_resource}")
|
120
120
|
if @new_resource.link_type == :symbolic
|
121
|
-
|
121
|
+
unless (::File.symlink?(@new_resource.target_file) && ::File.readlink(@new_resource.target_file) == @new_resource.to)
|
122
|
+
if ::File.symlink?(@new_resource.target_file) || ::File.exist?(@new_resource.target_file)
|
123
|
+
::File.unlink(@new_resource.target_file)
|
124
|
+
end
|
125
|
+
::File.symlink(@new_resource.to,@new_resource.target_file)
|
126
|
+
end
|
122
127
|
elsif @new_resource.link_type == :hard
|
123
128
|
::File.link(@new_resource.to, @new_resource.target_file)
|
124
129
|
end
|
125
|
-
@new_resource.
|
130
|
+
@new_resource.updated_by_last_action(true)
|
126
131
|
end
|
127
132
|
if @new_resource.link_type == :symbolic
|
128
133
|
set_owner unless @new_resource.owner.nil?
|
@@ -135,7 +140,7 @@ class Chef
|
|
135
140
|
if ::File.symlink?(@new_resource.target_file)
|
136
141
|
Chef::Log.info("Deleting #{@new_resource} at #{@new_resource.target_file}")
|
137
142
|
::File.delete(@new_resource.target_file)
|
138
|
-
@new_resource.
|
143
|
+
@new_resource.updated_by_last_action(true)
|
139
144
|
elsif ::File.exists?(@new_resource.target_file)
|
140
145
|
raise Chef::Exceptions::Link, "Cannot delete #{@new_resource} at #{@new_resource.target_file}! Not a symbolic link."
|
141
146
|
end
|
@@ -144,7 +149,7 @@ class Chef
|
|
144
149
|
if ::File.exists?(@new_resource.to) && ::File.stat(@current_resource.target_file).ino == ::File.stat(@new_resource.to).ino
|
145
150
|
Chef::Log.info("Deleting #{@new_resource} at #{@new_resource.target_file}")
|
146
151
|
::File.delete(@new_resource.target_file)
|
147
|
-
@new_resource.
|
152
|
+
@new_resource.updated_by_last_action(true)
|
148
153
|
else
|
149
154
|
raise Chef::Exceptions::Link, "Cannot delete #{@new_resource} at #{@new_resource.target_file}! Not a hard link."
|
150
155
|
end
|
data/lib/chef/provider/log.rb
CHANGED
data/lib/chef/provider/mdadm.rb
CHANGED
@@ -56,7 +56,7 @@ class Chef
|
|
56
56
|
#pid, stdin, stdout, stderr = popen4(command)
|
57
57
|
shell_out!(command)
|
58
58
|
Chef::Log.info("Created mdadm raid device (#{@new_resource.raid_device})")
|
59
|
-
@new_resource.
|
59
|
+
@new_resource.updated_by_last_action(true)
|
60
60
|
else
|
61
61
|
Chef::Log.debug("mdadm raid device already exists, skipping create (#{@new_resource.raid_device})")
|
62
62
|
end
|
@@ -68,7 +68,7 @@ class Chef
|
|
68
68
|
Chef::Log.debug("mdadm command: #{command}")
|
69
69
|
shell_out!(command)
|
70
70
|
Chef::Log.info("Assembled mdadm raid device (#{@new_resource.raid_device})")
|
71
|
-
@new_resource.
|
71
|
+
@new_resource.updated_by_last_action(true)
|
72
72
|
else
|
73
73
|
Chef::Log.debug("mdadm raid device already exists, skipping assemble (#{@new_resource.raid_device})")
|
74
74
|
end
|
@@ -80,7 +80,7 @@ class Chef
|
|
80
80
|
Chef::Log.debug("mdadm command: #{command}")
|
81
81
|
shell_out!(command)
|
82
82
|
Chef::Log.info("Stopped mdadm raid device (#{@new_resource.raid_device})")
|
83
|
-
@new_resource.
|
83
|
+
@new_resource.updated_by_last_action(true)
|
84
84
|
else
|
85
85
|
Chef::Log.debug("mdadm raid device doesn't exist (#{@new_resource.raid_device})")
|
86
86
|
end
|
data/lib/chef/provider/mount.rb
CHANGED
@@ -31,7 +31,7 @@ class Chef
|
|
31
31
|
Chef::Log.debug("#{@new_resource}: attempting to mount")
|
32
32
|
status = mount_fs()
|
33
33
|
if status
|
34
|
-
@new_resource.
|
34
|
+
@new_resource.updated_by_last_action(true)
|
35
35
|
Chef::Log.info("#{@new_resource}: mounted successfully")
|
36
36
|
end
|
37
37
|
else
|
@@ -44,7 +44,7 @@ class Chef
|
|
44
44
|
Chef::Log.debug("#{@new_resource}: attempting to unmount")
|
45
45
|
status = umount_fs()
|
46
46
|
if status
|
47
|
-
@new_resource.
|
47
|
+
@new_resource.updated_by_last_action(true)
|
48
48
|
Chef::Log.info("#{@new_resource}: unmounted successfully")
|
49
49
|
end
|
50
50
|
else
|
@@ -60,7 +60,7 @@ class Chef
|
|
60
60
|
Chef::Log.debug("#{@new_resource}: attempting to remount")
|
61
61
|
status = remount_fs()
|
62
62
|
if status
|
63
|
-
@new_resource.
|
63
|
+
@new_resource.updated_by_last_action(true)
|
64
64
|
Chef::Log.info("#{@new_resource}: remounted successfully")
|
65
65
|
end
|
66
66
|
else
|
@@ -73,7 +73,7 @@ class Chef
|
|
73
73
|
unless @current_resource.enabled
|
74
74
|
status = enable_fs
|
75
75
|
if status
|
76
|
-
@new_resource.
|
76
|
+
@new_resource.updated_by_last_action(true)
|
77
77
|
Chef::Log.info("#{@new_resource}: enabled successfully")
|
78
78
|
else
|
79
79
|
Chef::Log.debug("#{@new_resource}: not enabling, already enabled")
|
@@ -85,7 +85,7 @@ class Chef
|
|
85
85
|
if @current_resource.enabled
|
86
86
|
status = disable_fs
|
87
87
|
if status
|
88
|
-
@new_resource.
|
88
|
+
@new_resource.updated_by_last_action(true)
|
89
89
|
Chef::Log.info("#{@new_resource}: disabled successfully")
|
90
90
|
else
|
91
91
|
Chef::Log.debug("#{@new_resource}: not disabling, already disabled")
|