From 686113531d23f30e9973d659c456ae33eb9cff1f Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 5 Feb 2016 15:00:00 -0800 Subject: autofixing whitespace cops 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment --- lib/chef/provider/mount/aix.rb | 6 +++--- lib/chef/provider/mount/mount.rb | 8 ++++---- lib/chef/provider/mount/solaris.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/chef/provider/mount') diff --git a/lib/chef/provider/mount/aix.rb b/lib/chef/provider/mount/aix.rb index 9df2e63bf4..12f0d67e6b 100644 --- a/lib/chef/provider/mount/aix.rb +++ b/lib/chef/provider/mount/aix.rb @@ -42,7 +42,7 @@ class Chef # lsfs o/p = #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct # search only for current mount point - shell_out("lsfs -c #{@new_resource.mount_point}").stdout.each_line do | line | + shell_out("lsfs -c #{@new_resource.mount_point}").stdout.each_line do |line| case line when /^#\s/ next @@ -61,7 +61,7 @@ class Chef Chef::Log.debug("Found mount #{device_fstab} to #{@new_resource.mount_point} in /etc/filesystems") next when /^#{Regexp.escape(@new_resource.mount_point)}/ - enabled=false + enabled = false Chef::Log.debug("Found conflicting mount point #{@new_resource.mount_point} in /etc/filesystems") end end @@ -167,7 +167,7 @@ class Chef end end ::File.open("/etc/filesystems", "w") do |fstab| - contents.each { |line| fstab.puts line} + contents.each { |line| fstab.puts line } end else Chef::Log.debug("#{@new_resource} is not enabled - nothing to do") diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb index 0daacbf96d..f8b8684a1b 100644 --- a/lib/chef/provider/mount/mount.rb +++ b/lib/chef/provider/mount/mount.rb @@ -170,7 +170,7 @@ class Chef found = false ::File.readlines("/etc/fstab").reverse_each do |line| if !found && line =~ /^#{device_fstab_regex}\s+#{Regexp.escape(@new_resource.mount_point)}\s/ - found = true + found = true Chef::Log.debug("#{@new_resource} is removed from fstab") next else @@ -179,7 +179,7 @@ class Chef end ::File.open("/etc/fstab", "w") do |fstab| - contents.reverse_each { |line| fstab.puts line} + contents.reverse_each { |line| fstab.puts line } end else Chef::Log.debug("#{@new_resource} is not enabled - nothing to do") @@ -237,13 +237,13 @@ class Chef def device_mount_regex if network_device? # ignore trailing slash - Regexp.escape(device_real)+"/?" + Regexp.escape(device_real) + "/?" elsif ::File.symlink?(device_real) # This regular expression tries to match device_real. If that does not match it will try to match the target of device_real. # So given a symlink like this: # /dev/mapper/vgroot-tmp.vol -> /dev/dm-9 # First it will try to match "/dev/mapper/vgroot-tmp.vol". If there is no match it will try matching for "/dev/dm-9". - "(?:#{Regexp.escape(device_real)}|#{Regexp.escape(::File.expand_path(::File.readlink(device_real),::File.dirname(device_real)))})" + "(?:#{Regexp.escape(device_real)}|#{Regexp.escape(::File.expand_path(::File.readlink(device_real), ::File.dirname(device_real)))})" else Regexp.escape(device_real) end diff --git a/lib/chef/provider/mount/solaris.rb b/lib/chef/provider/mount/solaris.rb index 4d2381b6d8..a5a7a327cb 100644 --- a/lib/chef/provider/mount/solaris.rb +++ b/lib/chef/provider/mount/solaris.rb @@ -236,7 +236,7 @@ class Chef found = false ::File.readlines(VFSTAB).reverse_each do |line| if !found && line =~ /^#{device_regex}\s+\S+\s+#{Regexp.escape(mount_point)}/ - found = true + found = true Chef::Log.debug("#{new_resource} is removed from vfstab") next end -- cgit v1.2.1