Skip to content

Commit

Permalink
Merge pull request kubernetes#50826 from huzhengchuan/fix/delete-dead…
Browse files Browse the repository at this point in the history
…code

Automatic merge from submit-queue

remove unused function in openstack cloud provider

**What this PR does / why we need it**:
List function not used in openstack cloud provider, and useless, I think need remove it.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
  • Loading branch information
Kubernetes Submit Queue committed Aug 17, 2017
2 parents b67b0ad + 05d3e9c commit 9aa04c7
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions pkg/cloudprovider/providers/openstack/openstack_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/golang/glog"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
"github.com/gophercloud/gophercloud/pagination"

"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
Expand All @@ -49,36 +48,6 @@ func (os *OpenStack) Instances() (cloudprovider.Instances, bool) {
return &Instances{compute}, true
}

func (i *Instances) List(name_filter string) ([]types.NodeName, error) {
glog.V(4).Infof("openstack List(%v) called", name_filter)

opts := servers.ListOpts{
Name: name_filter,
Status: "ACTIVE",
}
pager := servers.List(i.compute, opts)

ret := make([]types.NodeName, 0)
err := pager.EachPage(func(page pagination.Page) (bool, error) {
sList, err := servers.ExtractServers(page)
if err != nil {
return false, err
}
for i := range sList {
ret = append(ret, mapServerToNodeName(&sList[i]))
}
return true, nil
})
if err != nil {
return nil, err
}

glog.V(3).Infof("Found %v instances matching %v: %v",
len(ret), name_filter, ret)

return ret, nil
}

// Implementation of Instances.CurrentNodeName
// Note this is *not* necessarily the same as hostname.
func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
Expand Down

0 comments on commit 9aa04c7

Please sign in to comment.