Skip to content

Commit 4347ce3

Browse files
committed
Address Rubocop offenses
This commit addresses the following Rubocop offenses: - Performance/StringInclude - Style/ClassAndModuleChildren - Style/TernaryParentheses
1 parent c218e2e commit 4347ce3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/puppet/provider/zone/solaris.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def config_status
320320
config = getconfig
321321
result = {}
322322

323-
result[:autoboot] = (config[:autoboot]) ? config[:autoboot].to_sym : :true
323+
result[:autoboot] = config[:autoboot] ? config[:autoboot].to_sym : :true
324324
result[:pool] = config[:pool]
325325
result[:shares] = config[:shares]
326326
dir = config['inherit-pkg-dir']

lib/puppet/type/zone.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
the zone's filesystem (with the `path` attribute), the zone resource will
77
autorequire that directory."
88

9-
module Puppet::Zone
9+
module Puppet::Zone # rubocop:disable Style/ClassAndModuleChildren
1010
# Zone state machine
1111
class StateMachine
1212
# A silly little state machine.
@@ -200,7 +200,7 @@ def insync?(is)
200200
end
201201

202202
munge do |value|
203-
if %r{%s}.match?(value)
203+
if value.include?('%s')
204204
value % @resource[:name]
205205
else
206206
value

spec/acceptance/tests/zone_configured_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# inherit /sbin on solaris10 until PUP-3722
1212
def config_inherit_string(agent)
13-
if %r{solaris-10}.match?(agent['platform'])
13+
if agent['platform'].include?('solaris-10')
1414
"inherit => '/sbin'"
1515
else
1616
''

spec/acceptance/tests/zone_running_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# inherit /sbin on solaris10 until PUP-3722
1212
def config_inherit_string(agent)
13-
if %r{solaris-10}.match?(agent['platform'])
13+
if agent['platform'].include?('solaris-10')
1414
"inherit => '/sbin'"
1515
else
1616
''

0 commit comments

Comments
 (0)