Skip to content

Commit

Permalink
optimize duplicate openstack serverList judgement
Browse files Browse the repository at this point in the history
if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to do the judgement again
  • Loading branch information
NickrenREN committed Feb 6, 2017
1 parent 2d58a0e commit e750fd5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ func getServerByName(client *gophercloud.ServiceClient, name types.NodeName) (*s

if len(serverList) == 0 {
return nil, ErrNotFound
} else if len(serverList) > 1 {
return nil, ErrMultipleResults
}

return &serverList[0], nil
Expand Down

0 comments on commit e750fd5

Please sign in to comment.