From eea7be017e6e4fbf20d050fe0cd7358bfc1503bf Mon Sep 17 00:00:00 2001 From: antima-gupta Date: Thu, 20 Aug 2020 10:09:20 +0530 Subject: Updated the author. Added comment for mounted? method. Signed-off-by: antima-gupta --- lib/chef/provider/mount/linux.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb index 25a03c08be..919ca118bf 100644 --- a/lib/chef/provider/mount/linux.rb +++ b/lib/chef/provider/mount/linux.rb @@ -1,5 +1,5 @@ # -# Author:: Joshua Timberman () +# Author:: Antima Gupta () # Copyright:: Copyright (c) Chef Software Inc. # License:: Apache License, Version 2.0 # @@ -25,12 +25,14 @@ class Chef provides :mount, os: "linux" + # Check to see if the volume is mounted. + # "findmnt" outputs the mount points with volume. + # Convert the mount_point of the resource to a real path in case it + # contains symlinks in its parents dirs. + def mounted? mounted = false - # "mount" outputs the mount points as real paths. Convert - # the mount_point of the resource to a real path in case it - # contains symlinks in its parents dirs. real_mount_point = if ::File.exists? @new_resource.mount_point ::File.realpath(@new_resource.mount_point) else -- cgit v1.2.1