Skip to content

Commit

Permalink
Log already activated zFCP and DASD devices
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Mar 31, 2020
1 parent 1ffb1cf commit 8201c4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/modules/DASDController.rb
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,11 @@ def report_error(headline, message, details)
# @return [Boolean] Returns an error code (8 means 'unformatted').
def activate_disk_if_needed(channel, diag)
disk = find_disks.find { |d| d["channel"] == channel }
return ActivateDisk(channel, diag) unless disk && active_disk?(disk)
disk["formatted"] ? 0 : 8
if disk && active_disk?(disk)
log.info "Disk #{channel} is already active. Skipping the activation."
return disk["formatted"] ? 0 : 8
end
ActivateDisk(channel, diag) unless disk && active_disk?(disk)
end

# Determines whether the disk is activated or not
Expand Down
3 changes: 2 additions & 1 deletion src/modules/ZFCPController.rb
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def activate_controller(channel)
def ActivateDisk(channel, wwpn, lun)
disk = find_disk(channel, wwpn, lun)
if disk
log.info "Disk #{channel}:#{wwpn}:#{lun} is already active. Skipping activation."
log.info "Disk #{channel}:#{wwpn}:#{lun} is already active. Skipping the activation."
else
activate_controller(channel)
end
Expand Down Expand Up @@ -716,6 +716,7 @@ def activated_controllers
io = ctrl.fetch("resource", {}).fetch("io", []).first
io && io["active"]
end
log.info "Already activated controllers: #{ctrls}"
@activated_controllers = ctrls.map { |c| c["sysfs_bus_id"] }
end

Expand Down

0 comments on commit 8201c4e

Please sign in to comment.