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 +4 -4
- data/lib/ibm_power_hmc/connection.rb +8 -7
- data/lib/ibm_power_hmc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ceda6d2c9095912e1bcf9b7a24bcb0153bc34a5c437a41966be9036fffb858
|
4
|
+
data.tar.gz: 94d8d1706954d560303e96f8c793fde5e9b0a181a7e2657a75d5f37fb5977fa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
794
|
+
# @!method next_events(wait = true)
|
795
795
|
# Retrieve a list of events that occured since last call.
|
796
|
-
# @param
|
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(
|
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
|
807
|
-
|
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?
|