summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-11-23 15:06:35 -0800
committerTim Smith <tsmith84@gmail.com>2020-11-23 15:06:35 -0800
commit08649a6f24790103a2a6fb4204c7c640397688eb (patch)
tree4540ade048ce2e4abf1d1454840389462ad7ce94
parent01fdf53ada4aa10968501662b54a3f17c76cb9f4 (diff)
downloadchef-08649a6f24790103a2a6fb4204c7c640397688eb.tar.gz
Revert "Removed '/' from mount_point property."
This reverts commit f913aa17ecf387a62e38699854a4faba7e8030f6.
-rw-r--r--lib/chef/provider/mount.rb2
-rw-r--r--lib/chef/provider/mount/linux.rb2
-rw-r--r--lib/chef/resource/mount.rb8
3 files changed, 3 insertions, 9 deletions
diff --git a/lib/chef/provider/mount.rb b/lib/chef/provider/mount.rb
index f8c71c6706..e4592a810d 100644
--- a/lib/chef/provider/mount.rb
+++ b/lib/chef/provider/mount.rb
@@ -175,7 +175,7 @@ class Chef
# Returns the new_resource device as per device_type
def device_fstab
- # Removed "/" from the end of str, because it was causing idempotency issue.
+ # Removed "/" from the end of str, because it was causing idempotency issues
device = @new_resource.device.chomp("/")
case @new_resource.device_type
when :device
diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb
index 382e37d41a..260c8f9349 100644
--- a/lib/chef/provider/mount/linux.rb
+++ b/lib/chef/provider/mount/linux.rb
@@ -54,7 +54,7 @@ class Chef
mounted = true
logger.trace("Bind device #{device_logstring} mounted as #{real_mount_point}")
# Permalink for network device mounted to an existing mount point: https://rubular.com/r/JRTXXGFdQtwCD6
- when /\A#{Regexp.escape(real_mount_point)}\s+#{device_mount_regex}\[/
+ when %r{\A#{Regexp.escape(real_mount_point)}\s+#{device_mount_regex}\[}
mounted = true
logger.trace("Network device #{device_logstring} mounted as #{real_mount_point}")
end
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index c23ba9bbee..ed5d9a0e0b 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -41,7 +41,6 @@ class Chef
sensitive: true
property :mount_point, String, name_property: true,
- coerce: proc { |arg| arg.chomp("/") }, # Removed "/" from the end of str, because it was causing idempotency issue.
description: "The directory (or path) in which the device is to be mounted. Defaults to the name of the resource block if not provided."
property :device, String, identity: true,
@@ -66,7 +65,7 @@ class Chef
property :options, [Array, String, nil],
description: "An array or comma separated list of options for the mount.",
- coerce: proc { |arg| mount_options(arg) }, # Please see #mount_options method.
+ coerce: proc { |arg| arg.is_a?(String) ? arg.split(",") : arg },
default: %w{defaults}
property :dump, [Integer, FalseClass],
@@ -95,11 +94,6 @@ class Chef
@fstype = nil
end
- # Returns array of string without leading and trailing whitespace.
- def mount_options(options)
- (options.is_a?(String) ? options.split(",") : options).collect(&:strip)
- end
-
end
end
end