Method: IBMSmartCloud#storage_state_is?

Defined in:
lib/smartcloud.rb

#storage_state_is?(volume_id, state_string) ⇒ Boolean

Returns:

  • (Boolean)


449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/smartcloud.rb', line 449

def storage_state_is?(volume_id, state_string)
  v = describe_storage(volume_id)
  v = v.first if v.is_a?(Array)

  @last_storage_state||={}
  if @last_storage_state[volume_id.to_s] != v.State
    logger.debug "Volume: #{volume_id}; Current State: #{v.State}; Waiting for: #{state_string.to_s.upcase} " # log it every time it changes
  end
  @last_storage_state[volume_id.to_s] = v.State

  if v.State.to_s == state_string.to_s.upcase
    v
  else
    false
  end

end