Skip to content

Commit

Permalink
Handle review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adityadani committed Dec 6, 2017
1 parent b3b3d2e commit 6765b82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion drivers/node/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (s *ssh) YankDrive(n node.Node, driveNameToFail string, options node.Connec
}

driveID = strings.TrimRight(driveID, "\n")
driveNameToFail = strings.TrimRight(strings.TrimLeft(driveNameToFail, "/"), "/")
driveNameToFail = strings.Trim(driveNameToFail, "/")
devices := strings.Split(driveNameToFail, "/")

// Disable the block device, so that it returns IO errors
Expand Down
10 changes: 5 additions & 5 deletions drivers/volume/portworx/portworx.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,24 @@ func (d *portworx) GetStorageDevices(n node.Node) ([]string, error) {
resourcesKey = "Resources"
pathKey = "path"
)
pxNode, err := d.getClusterManager().Inspect(n.Name)
pxNode, err := d.getClusterManager().Inspect(n.VolDriverNodeID)
if err != nil {
return []string{}, err
return nil, err
}
devPaths := []string{}

storageInfo, ok := pxNode.NodeData[storageInfoKey]
if !ok {
return []string{}, fmt.Errorf("Unable to find storage info for node: %v", n.Name)
return nil, fmt.Errorf("Unable to find storage info for node: %v", n.Name)
}
storageInfoMap := storageInfo.(map[string]interface{})

resourcesMapIntf, ok := storageInfoMap[resourcesKey]
if !ok || resourcesMapIntf == nil {
return []string{}, fmt.Errorf("Unable to find resource info for node: %v", n.Name)
return nil, fmt.Errorf("Unable to find resource info for node: %v", n.Name)
}
resourcesMap := resourcesMapIntf.(map[string]interface{})

devPaths := []string{}
for _, v := range resourcesMap {
resource := v.(map[string]interface{})
path, _ := resource[pathKey]
Expand Down
7 changes: 2 additions & 5 deletions tests/drive_failure/drive_failure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ var _ = BeforeSuite(func() {
InitInstance()
})

func driveFailureTest(testName string) {
var _ = Describe("Induce drive failure on of the nodes", func() {
testName := "drivefailure"
It("has to schedule apps and induce a drive failure on one of the nodes", func() {
var err error
contexts := ScheduleAndValidate(testName)
Expand Down Expand Up @@ -90,10 +91,6 @@ func driveFailureTest(testName string) {
})

})
}

var _ = Describe("Induce drive failure on of the nodes", func() {
driveFailureTest("drivefailure")
})

var _ = AfterSuite(func() {
Expand Down

0 comments on commit 6765b82

Please sign in to comment.