Skip to content

Commit

Permalink
make IsMultipathConsistent public
Browse files Browse the repository at this point in the history
  • Loading branch information
plaffitt committed Jun 29, 2021
1 parent c5b263e commit 04852eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions iscsi/iscsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (c *Connector) Connect() (string, error) {
}

if c.IsMultipathEnabled() {
if err := c.isMultipathConsistent(); err != nil {
if err := c.IsMultipathConsistent(); err != nil {
return "", fmt.Errorf("multipath is inconsistent: %v", err)
}
}
Expand Down Expand Up @@ -405,7 +405,7 @@ func (c *Connector) DisconnectVolume() error {
// Note: make sure the volume is already unmounted before calling this method.

if c.IsMultipathEnabled() {
if err := c.isMultipathConsistent(); err != nil {
if err := c.IsMultipathConsistent(); err != nil {
return fmt.Errorf("multipath is inconsistent: %v", err)
}

Expand Down Expand Up @@ -616,7 +616,7 @@ func GetConnectorFromFile(filePath string) (*Connector, error) {
return &c, nil
}

func (c *Connector) isMultipathConsistent() error {
func (c *Connector) IsMultipathConsistent() error {
devices := append([]Device{*c.MountTargetDevice}, c.Devices...)

referenceLUN := struct {
Expand Down
4 changes: 2 additions & 2 deletions iscsi/iscsi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func TestConnectorPersistance(t *testing.T) {
assert.IsType(&json.SyntaxError{}, err)
}

func Test_isMultipathConsistent(t *testing.T) {
func Test_IsMultipathConsistent(t *testing.T) {
mpath1 := Device{Name: "3600c0ff0000000000000000000000000", Type: "mpath", Size: "10G", Hctl: "0:0:0:1"}
mpath2 := Device{Name: "3600c0ff0000000000000000000000042", Type: "mpath", Size: "5G", Hctl: "0:0:0:2"}
sda := Device{Name: "sda", Size: "10G", Hctl: "1:0:0:1"}
Expand Down Expand Up @@ -826,7 +826,7 @@ func Test_isMultipathConsistent(t *testing.T) {
return []byte(wwid + "\n"), nil
}).Reset()

err := c.isMultipathConsistent()
err := c.IsMultipathConsistent()

if tt.wantErr {
assert.Error(err)
Expand Down

0 comments on commit 04852eb

Please sign in to comment.