diff options
author | Thom May <thom@chef.io> | 2018-03-09 18:28:47 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2018-03-14 16:29:48 +0000 |
commit | 61e3d4bb382da5a0f6c09dd144ce4c6fc96c3ca9 (patch) | |
tree | c83baedaba2f265ebc85a4be907ad2c0ea0c26a8 /lib/chef/provider/mount/mount.rb | |
parent | f1c97d18f68b01e8f82757bbb1111ca82d4fba99 (diff) | |
download | chef-61e3d4bb382da5a0f6c09dd144ce4c6fc96c3ca9.tar.gz |
update mount to use properties and fix 6851
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/provider/mount/mount.rb')
-rw-r--r-- | lib/chef/provider/mount/mount.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb index 0be45e80da..dd35a84186 100644 --- a/lib/chef/provider/mount/mount.rb +++ b/lib/chef/provider/mount/mount.rb @@ -57,12 +57,13 @@ class Chef case line when /^[#\s]/ next - when /^#{device_fstab_regex}\s+#{Regexp.escape(@new_resource.mount_point)}\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/ + when /^(#{device_fstab_regex})\s+#{Regexp.escape(@new_resource.mount_point)}\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/ enabled = true - @current_resource.fstype($1) - @current_resource.options($2) - @current_resource.dump($3.to_i) - @current_resource.pass($4.to_i) + @current_resource.device($1) + @current_resource.fstype($2) + @current_resource.options($3) + @current_resource.dump($4.to_i) + @current_resource.pass($5.to_i) Chef::Log.debug("Found mount #{device_fstab} to #{@new_resource.mount_point} in /etc/fstab") next when /^[\/\w]+\s+#{Regexp.escape(@new_resource.mount_point)}\s+/ @@ -152,7 +153,7 @@ class Chef end def enable_fs - if @current_resource.enabled && mount_options_unchanged? + if @current_resource.enabled && mount_options_unchanged? && device_unchanged? Chef::Log.debug("#{@new_resource} is already enabled - nothing to do") return nil end @@ -258,7 +259,7 @@ class Chef if @new_resource.device_type == :device device_mount_regex else - device_fstab + Regexp.union(device_fstab, device_mount_regex) end end |