summaryrefslogtreecommitdiff
path: root/lib/chef/provider/mount/mount.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-16 10:35:35 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-16 10:35:35 -0700
commit04a23bb2d1b3243f09e7c63f2c755fbaefcd5d87 (patch)
treef3edd4a0f410d589ee10f30d4e4c873cd9a8a7ad /lib/chef/provider/mount/mount.rb
parentb4e7913972e70b42e632a33930417fb37d2bddd1 (diff)
downloadchef-04a23bb2d1b3243f09e7c63f2c755fbaefcd5d87.tar.gz
Avoid using complex regexes when we can use include?
The ifconfig part needs a complete rewrite, but this is better. At least it's not doing a regex twice for each thing it wants to match per line. It still does 5 regexes even if it matches on the first. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/provider/mount/mount.rb')
-rw-r--r--lib/chef/provider/mount/mount.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 6e39f6549b..e3aa7e6d1c 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -201,7 +201,7 @@ class Chef
end
def network_device?
- @new_resource.device =~ /:/ || @new_resource.device =~ %r{//}
+ @new_resource.device.include?(":") || @new_resource.device.include?("//")
end
def device_should_exist?