Skip to content

Commit

Permalink
Merge pull request #1042 from bgilbert/devalias
Browse files Browse the repository at this point in the history
stages/disks: get filesystem info via device alias
  • Loading branch information
bgilbert committed Jul 24, 2020
2 parents 132625a + c153a00 commit 839e2bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/exec/stages/disks/filesystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,19 @@ func (s stage) createFilesystem(fs types.Filesystem) error {
if fs.Format == nil {
return nil
}
devAlias := util.DeviceAlias(string(fs.Device))

var info util.FilesystemInfo
err := s.Logger.LogOp(
func() error {
var err error
info, err = util.GetFilesystemInfo(fs.Device, false)
info, err = util.GetFilesystemInfo(devAlias, false)
if err != nil {
// Try again, allowing multiple filesystem
// fingerprints this time. If successful,
// log a warning and continue.
var err2 error
info, err2 = util.GetFilesystemInfo(fs.Device, true)
info, err2 = util.GetFilesystemInfo(devAlias, true)
if err2 == nil {
s.Logger.Warning("%v", err)
}
Expand Down Expand Up @@ -131,7 +132,6 @@ func (s stage) createFilesystem(fs types.Filesystem) error {
}
}

devAlias := util.DeviceAlias(string(fs.Device))
if _, err := s.Logger.LogCmd(
exec.Command(distro.WipefsCmd(), "-a", devAlias),
"wiping filesystem signatures from %q",
Expand Down

0 comments on commit 839e2bd

Please sign in to comment.