openstack: Return instance name in CurrentNodeName

Previously the OpenStack provider just returned the hostname in
CurrentNodeName.  With this change, we return the local OpenStack
instance name, as the API intended.
This commit is contained in:
Angus Lees 2016-08-30 12:34:47 +10:00
parent 3745e0f88c
commit 8167df2965

View File

@ -113,8 +113,13 @@ func (i *Instances) List(name_filter string) ([]types.NodeName, error) {
}
// Implementation of Instances.CurrentNodeName
// Note this is *not* necessarily the same as hostname.
func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
return types.NodeName(hostname), nil
md, err := getMetadata()
if err != nil {
return "", err
}
return types.NodeName(md.Name), nil
}
func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error {