summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-12 15:02:26 -0800
committerGitHub <noreply@github.com>2021-02-12 15:02:26 -0800
commit829c7b0cf4031a391c3aca263e962e5b839137d1 (patch)
tree6e967a21df467e1e452a2fc40f1fe334261ab4a3
parentbd4502cd5585a4c4287208bd107136cba9416ec3 (diff)
parent950a3e4e7c85ccdc88162f89a7f6eba8807f02d7 (diff)
downloadchef-829c7b0cf4031a391c3aca263e962e5b839137d1.tar.gz
Merge pull request #11035 from chef/mount_16
mount: Fix for network mounts which use the root level as the device
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--spec/unit/provider/mount/mount_spec.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 0bd81d5453..12406b7f47 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -203,7 +203,7 @@ class Chef
end
end
# Removed "/" from the end of str, because it was causing idempotency issue.
- @real_device == "/" ? @real_device : @real_device.chomp("/")
+ (@real_device == "/" || @real_device.match?(":/$")) ? @real_device : @real_device.chomp("/")
end
def device_logstring
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index 9a7d9198b5..015e0038c8 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -66,6 +66,7 @@ describe Chef::Provider::Mount::Mount do
describe "when dealing with network mounts" do
{ "nfs" => "nfsserver:/vol/path",
+ "cephfs" => "cephserver:6789:/",
"cifs" => "//cifsserver/share" }.each do |type, fs_spec|
it "should detect network fs_spec (#{type})" do
@new_resource.device fs_spec