Class: Chef::Provider::Mount
Direct Known Subclasses
Mount
Defined Under Namespace
Classes: Mount
Instance Attribute Summary
#current_resource, #new_resource, #node
Instance Method Summary
collapse
handle_command_failures, not_if, only_if, output_of_command, popen4, run_command, run_command_with_systems_locale
#action_nothing, build_from_file, #initialize, #load_current_resource
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string
#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
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/chef/provider/mount.rb', line 84
def action_disable
if @current_resource.enabled
status = disable_fs
if status
@new_resource.updated = true
Chef::Log.info("#{@new_resource}: disabled successfully")
else
Chef::Log.debug("#{@new_resource}: not disabling, already disabled")
end
end
end
|
#action_enable ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/chef/provider/mount.rb', line 72
def action_enable
unless @current_resource.enabled
status = enable_fs
if status
@new_resource.updated = true
Chef::Log.info("#{@new_resource}: enabled successfully")
else
Chef::Log.debug("#{@new_resource}: not enabling, already enabled")
end
end
end
|
#action_mount ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/chef/provider/mount.rb', line 29
def action_mount
unless @current_resource.mounted
Chef::Log.debug("#{@new_resource}: attempting to mount")
status = mount_fs()
if status
@new_resource.updated = true
Chef::Log.info("#{@new_resource}: mounted successfully")
end
else
Chef::Log.debug("#{@new_resource}: not mounting, already mounted")
end
end
|
#action_remount ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/chef/provider/mount.rb', line 55
def action_remount
unless @new_resource.supports[:remount]
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :remount"
else
if @current_resource.mounted
Chef::Log.debug("#{@new_resource}: attempting to remount")
status = remount_fs()
if status
@new_resource.updated = true
Chef::Log.info("#{@new_resource}: remounted successfully")
end
else
Chef::Log.debug("#{@new_resource}: not mounted, not remounting")
end
end
end
|
#action_umount ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/chef/provider/mount.rb', line 42
def action_umount
if @current_resource.mounted
Chef::Log.debug("#{@new_resource}: attempting to unmount")
status = umount_fs()
if status
@new_resource.updated = true
Chef::Log.info("#{@new_resource}: unmounted successfully")
end
else
Chef::Log.debug("#{@new_resource}: not unmounting, already unmounted")
end
end
|