Commit 8167df29 authored by Angus Lees's avatar Angus Lees

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.
parent 3745e0f8
...@@ -113,8 +113,13 @@ func (i *Instances) List(name_filter string) ([]types.NodeName, error) { ...@@ -113,8 +113,13 @@ func (i *Instances) List(name_filter string) ([]types.NodeName, error) {
} }
// Implementation of Instances.CurrentNodeName // Implementation of Instances.CurrentNodeName
// Note this is *not* necessarily the same as hostname.
func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) { 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 { func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error {
......
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