Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Adding debug message matching of sg_inq output
Browse files Browse the repository at this point in the history
  • Loading branch information
tzurE committed Mar 20, 2018
1 parent 9a113c5 commit 99a9f66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion remote/mounter/block_device_utils/mpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (b *blockDeviceUtils) GetWwnByScsiInq(dev string) (string, error) {
}
/* x86 systems returns 'Vendor Specific Identifier Extension' and zLinux systems
return Vendor Specific Extension Identifier. */
pattern := "(?i)" + "Vendor Specific (Identifier Extension|Extension Identifier):"
pattern := "(?i)" + "Vendor Specific (Identifier Extension|Extension Identifier)"
scanner := bufio.NewScanner(strings.NewReader(string(outputBytes[:])))
regex, err := regexp.Compile(pattern)
if err != nil {
Expand All @@ -207,6 +207,7 @@ func (b *blockDeviceUtils) GetWwnByScsiInq(dev string) (string, error) {
b.logger.Debug(fmt.Sprintf("Found the expected Wwn [%s] in sg_inq.", wwn))
return wwn, nil
}
b.logger.Debug(fmt.Sprintf("line: %s", line))
if regex.MatchString(line) {
found = true
// its one line after "Vendor Specific Identifier Extension:" line which should contain the WWN
Expand Down

0 comments on commit 99a9f66

Please sign in to comment.