Class: Chef::Provider::Mount
Defined Under Namespace
Classes: Mount, Windows
Instance Attribute Summary
#action, #current_resource, #new_resource, #run_context
Instance Method Summary
collapse
#chdir_or_tmpdir, #handle_command_failures, #output_of_command, #run_command, #run_command_with_systems_locale
#popen4
#popen4
#action_nothing, #cleanup_after_converge, #cookbook_name, #define_resource_requirements, #events, #initialize, #node, #process_resource_requirements, #requirements, #resource_collection, #run_action, #set_updated_status, #whyrun_mode?
#method_missing
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename
Constructor Details
This class inherits a constructor from Chef::Provider
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Chef::DSL::Recipe
Instance Method Details
#action_disable ⇒ Object
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/chef/provider/mount.rb', line 94
def action_disable
if @current_resource.enabled
converge_by("remount #{@current_resource.device}") do
status = disable_fs
if status
Chef::Log.info("#{@new_resource} disabled")
else
Chef::Log.debug("#{@new_resource} already disabled")
end
end
end
end
|
#action_enable ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/chef/provider/mount.rb', line 81
def action_enable
unless @current_resource.enabled
converge_by("remount #{@current_resource.device}") do
status = enable_fs
if status
Chef::Log.info("#{@new_resource} enabled")
else
Chef::Log.debug("#{@new_resource} already enabled")
end
end
end
end
|
#action_mount ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/chef/provider/mount.rb', line 38
def action_mount
unless @current_resource.mounted
converge_by("mount #{@current_resource.device} to #{@current_resource.mount_point}") do
status = mount_fs()
if status
Chef::Log.info("#{@new_resource} mounted")
end
end
else
Chef::Log.debug("#{@new_resource} is already mounted")
end
end
|
#action_remount ⇒ Object
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/chef/provider/mount.rb', line 64
def action_remount
unless @new_resource.supports[:remount]
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :remount"
else
if @current_resource.mounted
converge_by("remount #{@current_resource.device}") do
status = remount_fs()
if status
Chef::Log.info("#{@new_resource} remounted")
end
end
else
Chef::Log.debug("#{@new_resource} not mounted, nothing to remount")
end
end
end
|
#action_umount ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/chef/provider/mount.rb', line 51
def action_umount
if @current_resource.mounted
converge_by("unmount #{@current_resource.device}") do
status = umount_fs()
if status
Chef::Log.info("#{@new_resource} unmounted")
end
end
else
Chef::Log.debug("#{@new_resource} is already unmounted")
end
end
|
#load_current_resource ⇒ Object
34
35
36
|
# File 'lib/chef/provider/mount.rb', line 34
def load_current_resource
true
end
|
107
108
109
|
# File 'lib/chef/provider/mount.rb', line 107
def mount_fs
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :mount"
end
|
#whyrun_supported? ⇒ Boolean
30
31
32
|
# File 'lib/chef/provider/mount.rb', line 30
def whyrun_supported?
true
end
|