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
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_by_last_action(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_by_last_action(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_by_last_action(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_by_last_action(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_by_last_action(true)
Chef::Log.info("#{@new_resource}: unmounted successfully")
end
else
Chef::Log.debug("#{@new_resource}: not unmounting, already unmounted")
end
end
|
#disable_fs ⇒ Object
112
113
114
|
# File 'lib/chef/provider/mount.rb', line 112
def disable_fs
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :disable"
end
|
#enable_fs ⇒ Object
108
109
110
|
# File 'lib/chef/provider/mount.rb', line 108
def enable_fs
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :enable"
end
|
#remount_fs ⇒ Object
104
105
106
|
# File 'lib/chef/provider/mount.rb', line 104
def remount_fs
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :remount"
end
|
#umount_fs ⇒ Object
100
101
102
|
# File 'lib/chef/provider/mount.rb', line 100
def umount_fs
raise Chef::Exceptions::UnsupportedAction, "#{self.to_s} does not support :umount"
end
|