Commit 70ab5fc6 authored by NickrenREN's avatar NickrenREN

optimize duplicate openstack serverList judgement

if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to do the judgement again
parent 1df1ad9d
...@@ -295,8 +295,6 @@ func getServerByName(client *gophercloud.ServiceClient, name types.NodeName) (*s ...@@ -295,8 +295,6 @@ func getServerByName(client *gophercloud.ServiceClient, name types.NodeName) (*s
if len(serverList) == 0 { if len(serverList) == 0 {
return nil, ErrNotFound return nil, ErrNotFound
} else if len(serverList) > 1 {
return nil, ErrMultipleResults
} }
return &serverList[0], nil return &serverList[0], nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment