diff options
author | Lance Albertson <lance@osuosl.org> | 2021-02-12 11:06:56 -0800 |
---|---|---|
committer | Lance Albertson <lance@osuosl.org> | 2021-02-12 11:10:14 -0800 |
commit | 3ca53d4c6d412a6cc11892357867889e0f5ac89b (patch) | |
tree | 2c77d8e36a8872364284726de3d58034b5791638 /lib/chef/provider | |
parent | 4cfb8455fcc4ffcb452c43666b0f02c140d94d82 (diff) | |
download | chef-3ca53d4c6d412a6cc11892357867889e0f5ac89b.tar.gz |
Fix network mounts which use the root level as the device
PR #10614 introduce a bug which can impact network mounts which try to mount
from the root level (i.e. server:/). Specifically, we run into this on cephfs
where this is pretty common. This adds some logic to detect if this is a network
mount at the root level and doesn't strip the '/'.
This resolves #10764.
Signed-off-by: Lance Albertson <lance@osuosl.org>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/mount/mount.rb | 2 |
1 files changed, 1 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 |