Skip to content

Commit 4352717

Browse files
author
Adam Spiers
committed
fix some rubocop offences
1 parent 40d9a8e commit 4352717

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

chef/cookbooks/crowbar-pacemaker/libraries/maintenance_mode_helpers.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module CrowbarPacemaker
2020
module MaintenanceModeHelpers
2121
def maintenance_mode?
2222
# See https://bugzilla.suse.com/show_bug.cgi?id=870696
23-
!! (%x(crm_attribute -G -N #{node.hostname} -n maintenance -q) =~ /^on$/)
23+
`crm_attribute -G -N #{node.hostname} -n maintenance -q` =~ /^on$/
2424
end
2525

2626
def set_maintenance_mode_via_this_chef_run
@@ -32,14 +32,14 @@ def set_maintenance_mode_via_this_chef_run
3232
#
3333
# We use a default attribute so that it will get reset at the
3434
# beginning of each chef-client run.
35-
node.default[:pacemaker][:maintenance_mode][$$][:via_chef] = true
35+
node.default[:pacemaker][:maintenance_mode][$PID][:via_chef] = true
3636
end
3737

3838
def maintenance_mode_set_via_this_chef_run?
3939
# The "== true" is required because Chef::Node::Attribute does
4040
# auto-vivification on read (!), so the value will be initialized
4141
# to an empty Chef::Node::Attribute if not already set to true.
42-
node.default[:pacemaker][:maintenance_mode][$$][:via_chef] == true
42+
node.default[:pacemaker][:maintenance_mode][$PID][:via_chef] == true
4343
end
4444
end
4545
end

chef/cookbooks/crowbar-pacemaker/recipes/maintenance-mode.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
if loaded
5858
Chef::Log.debug("Pacemaker maintenance handlers already installed")
5959
else
60-
Chef::Log.info("Pacemaker maintenance handlers not installed; " +
60+
Chef::Log.info("Pacemaker maintenance handlers not installed; " \
6161
"scheduling Chef config reload")
6262
ruby_block "reload_chef_client_config" do
6363
block { Chef::Config.from_file("/etc/chef/client.rb") }

0 commit comments

Comments
 (0)