Skip to content

Commit

Permalink
Appease rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMysteriousX authored and majormoses committed Mar 27, 2019
1 parent c8e302e commit 1e8198d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions bin/check-graylog-buffers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ def call_api(path, postdata = nil)
if !postdata
JSON.parse(resource.get)
else
JSON.parse(resource.post(
postdata.to_json,
content_type: :json,
accept: :json,
x_requested_by: "sensu-client on #{settings['client']['name']}"
))
JSON.parse(
resource.post(
postdata.to_json,
content_type: :json,
accept: :json,
x_requested_by: "sensu-client on #{settings['client']['name']}"
)
)
end
rescue Errno::ECONNREFUSED => e
critical e.message
Expand Down
8 changes: 4 additions & 4 deletions test/check-graylog-buffers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
args = %w(--username foo --password bar --host localhost --port 12900)

check = CheckGraylogBuffers.new(args)
check.instance_variable_set('@settings', {'client' => {'name' => 'sensu.example.org'}})
check.instance_variable_set('@settings', 'client' => { 'name' => 'sensu.example.org' })
expect(check).to receive(:ok).with('process buffer utilization is 50.12%').and_raise(SystemExit)
expect { check.run }.to raise_error(SystemExit)
end
Expand Down Expand Up @@ -73,7 +73,7 @@
args = %w(--username foo --password bar --host localhost --port 12900)

check = CheckGraylogBuffers.new(args)
check.instance_variable_set('@settings', {'client' => {'name' => 'sensu.example.org'}})
check.instance_variable_set('@settings', 'client' => { 'name' => 'sensu.example.org' })
expect(check).to receive(:critical).with('process buffer utilization is 99.99%, threshold is 90.00%').and_raise(SystemExit)
expect { check.run }.to raise_error(SystemExit)
end
Expand Down Expand Up @@ -140,7 +140,7 @@
args = %w(--username foo --password bar --host localhost --port 12900)

check = CheckGraylogBuffers.new(args)
check.instance_variable_set('@settings', {'client' => {'name' => 'sensu.example.org'}})
check.instance_variable_set('@settings', 'client' => { 'name' => 'sensu.example.org' })
expect(check).to receive(:ok).with('buffer utilization is 0.00%/0.01%/0.01%').and_raise(SystemExit)
expect { check.run }.to raise_error(SystemExit)
end
Expand Down Expand Up @@ -207,7 +207,7 @@
args = %w(--username foo --password bar --host localhost --port 12900)

check = CheckGraylogBuffers.new(args)
check.instance_variable_set('@settings', {'client' => {'name' => 'sensu.example.org'}})
check.instance_variable_set('@settings', 'client' => { 'name' => 'sensu.example.org' })
expect(check).to receive(:critical).with('output buffer exceeds 90.00%, buffer utilization is 0.00%/0.01%/99.18%').and_raise(SystemExit)
expect { check.run }.to raise_error(SystemExit)
end
Expand Down

0 comments on commit 1e8198d

Please sign in to comment.