Class: Chef::Provider::Mount
Defined Under Namespace
Classes: Mount, Windows
Instance Attribute Summary
#current_resource, #new_resource, #run_context
Instance Method Summary
collapse
#chdir_or_tmpdir, #handle_command_failures, #not_if, #only_if, #output_of_command, #run_command, #run_command_with_systems_locale
#popen4
#popen4
#action_nothing, build_from_file, #cookbook_name, #initialize, #load_current_resource, #node, #resource_collection
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename
#method_missing
#data_bag, #data_bag_item, #platform?, #search, #value_for_platform
Constructor Details
This class inherits a constructor from Chef::Provider
Instance Method Details
#action_disable ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/chef/provider/mount.rb', line 81
def action_disable
if @current_resource.enabled
status = disable_fs
if status
@new_resource.updated_by_last_action(true)
Chef::Log.info("#{@new_resource} disabled")
else
Chef::Log.debug("#{@new_resource} already disabled")
end
end
end
|
#action_enable ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/chef/provider/mount.rb', line 69
def action_enable
unless @current_resource.enabled
status = enable_fs
if status
@new_resource.updated_by_last_action(true)
Chef::Log.info("#{@new_resource} enabled")
else
Chef::Log.debug("#{@new_resource} already enabled")
end
end
end
|
#action_mount ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/chef/provider/mount.rb', line 29
def action_mount
unless @current_resource.mounted
status = mount_fs()
if status
@new_resource.updated_by_last_action(true)
Chef::Log.info("#{@new_resource} mounted")
end
else
Chef::Log.debug("#{@new_resource} is already mounted")
end
end
|
#action_remount ⇒ Object
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/chef/provider/mount.rb', line 53
def action_remount
unless @new_resource.supports[:remount]
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :remount"
else
if @current_resource.mounted
status = remount_fs()
if status
@new_resource.updated_by_last_action(true)
Chef::Log.info("#{@new_resource} remounted")
end
else
Chef::Log.debug("#{@new_resource} not mounted, nothing to remount")
end
end
end
|
#action_umount ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/chef/provider/mount.rb', line 41
def action_umount
if @current_resource.mounted
status = umount_fs()
if status
@new_resource.updated_by_last_action(true)
Chef::Log.info("#{@new_resource} unmounted")
end
else
Chef::Log.debug("#{@new_resource} is already unmounted")
end
end
|