summaryrefslogtreecommitdiff
path: root/lib/chef/provider/mount/mount.rb
diff options
context:
space:
mode:
authorsmriti <sgarg@msystechnologies.com>2021-05-26 14:41:53 +0530
committerpratixha <pratiksha.prajapati@msystechnologies.com>2022-04-06 12:54:38 +0530
commitdaace13458d0e144d4d1807dd5390915caea9842 (patch)
tree499552d0d990ab2a809b9e44496f14626d93ae5f /lib/chef/provider/mount/mount.rb
parentf61168f78a52f28c170feb3c6a65061d91e7cb25 (diff)
downloadchef-daace13458d0e144d4d1807dd5390915caea9842.tar.gz
Mount: device name space character substituted with ascii value
Signed-off-by: smriti <sgarg@msystechnologies.com>
Diffstat (limited to 'lib/chef/provider/mount/mount.rb')
-rw-r--r--lib/chef/provider/mount/mount.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 2bc9d2c78f..6b062d1225 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -217,6 +217,14 @@ class Chef
end
end
+ def device_with_space_escape
+ # For CIFS (and perhaps other remote network mounts) when a space is in the "device name"
+ # it will appear with the space substituted with a special character. However, when mounting,
+ # the mount needs to be done with an actual space. This function provides the device name with
+ # the special character to determine if the device is mounted.
+ device_mount_regex.gsub(" ", "\\x20")
+ end
+
def device_mount_regex
if network_device?
# ignore trailing slash