summaryrefslogtreecommitdiff
path: root/lib/chef/resource/hostname.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-05 11:44:16 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:41:14 -0700
commit7bf98ad06b30b7feb4ea3fbbe45a5b733467a5d3 (patch)
treeb0995ded1a63654d3f54140bd880c69f86afd52f /lib/chef/resource/hostname.rb
parent9802d7c075c8b7dae42dbcecd92d492f7fa128ac (diff)
downloadchef-7bf98ad06b30b7feb4ea3fbbe45a5b733467a5d3.tar.gz
Style/RegexpLiteral
given how many regexps we have with /'s in the match this seems like a very good one. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource/hostname.rb')
-rw-r--r--lib/chef/resource/hostname.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 71160e983e..dab599c272 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -203,7 +203,7 @@ class Chef
declare_resource(:execute, "svccfg -s system/identity:node setprop config/nodename=\'#{new_resource.hostname}\'") do
notifies :run, "execute[svcadm refresh]", :immediately
notifies :run, "execute[svcadm restart]", :immediately
- not_if { shell_out!("svccfg -s system/identity:node listprop config/nodename").stdout.chomp =~ /config\/nodename\s+astring\s+#{new_resource.hostname}/ }
+ not_if { shell_out!("svccfg -s system/identity:node listprop config/nodename").stdout.chomp =~ %r{config/nodename\s+astring\s+#{new_resource.hostname}} }
end
declare_resource(:execute, "svcadm refresh") do
command "svcadm refresh system/identity:node"