ibm_power_hmc 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: faeaaee474f96b0beb9747a2d346110a1321e9060b2b196770598f1bccfd85a8
4
- data.tar.gz: 3af51fcdb06f722a95e44bcea28f8ed4f4fef9cdfd9e1332063c3bf288a00c61
3
+ metadata.gz: 28ceda6d2c9095912e1bcf9b7a24bcb0153bc34a5c437a41966be9036fffb858
4
+ data.tar.gz: 94d8d1706954d560303e96f8c793fde5e9b0a181a7e2657a75d5f37fb5977fa3
5
5
  SHA512:
6
- metadata.gz: 1756c8a220a30ba88da0cd0d518a681657f9d08a231c11715e461d0fe5be1c171b17e98bb290fd29f9cdb551da48cdfc699707147abded7cfa204dcde26067be
7
- data.tar.gz: 8906b25b90865262000331f4c371b546cac852eeb14714e8c75b0e7ae937422d441a1c920687d4e8913dad088a9eadbbbb7a5d740fceccd57f9733e9112ce2bc
6
+ metadata.gz: c001400d781dbadea9f68df8dc4eb5266ac6c3e74a9d8035ed7c112b404ec7553c8b97eab297dd72ce22919b024d8eaa3cfb30bf133514df1eae266ce198252b
7
+ data.tar.gz: 62dd1000797804b87a22528c711e777c07071d80df40621f6007d88e5b68ed90da6413888eee5e185379a15a9da522cfb0cbaa9c693640ccedecad23b2af9bd9
@@ -791,20 +791,21 @@ module IbmPowerHmc
791
791
  end
792
792
 
793
793
  ##
794
- # @!method next_events(timeout = -1)
794
+ # @!method next_events(wait = true)
795
795
  # Retrieve a list of events that occured since last call.
796
- # @param timeout [Integer] The number of seconds to wait if no event is available.
797
- # Specify -1 to wait indefinitely.
796
+ # @param wait [Boolean] If no event is available, block until new events occur.
798
797
  # @return [Array<IbmPowerHmc::Event>] The list of events.
799
- def next_events(timeout = -1)
798
+ def next_events(wait = true)
800
799
  method_url = "/rest/api/uom/Event"
801
- method_url += "?timeout=#{timeout}" if timeout >= 0
802
800
 
803
801
  response = nil
804
802
  loop do
805
803
  response = request(:get, method_url)
806
- # The HMC waits "timeout" seconds (10 if not specified) before returning 204.
807
- break if response.code != 204 || timeout >= 0
804
+ # The HMC waits 10 seconds before returning 204 if there is no event.
805
+ # There is a hidden "?timeout=X" option but it does not always work.
806
+ # It will return "REST026C Maximum number of event requests exceeded"
807
+ # after a while.
808
+ break if response.code != 204 || !wait
808
809
  end
809
810
  FeedParser.new(response.body).objects(:Event).map do |e|
810
811
  data = e.data.split("/") unless e.data.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbmPowerHmc
4
- VERSION = "0.16.0"
4
+ VERSION = "0.16.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_power_hmc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - IBM Power