cloudprovider: add support for InstanceID method

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli
2015-05-08 11:19:17 -04:00
parent 194343267d
commit faba12951a
9 changed files with 51 additions and 8 deletions

View File

@@ -142,7 +142,7 @@ func (v *VagrantCloud) NodeAddresses(instance string) ([]api.NodeAddress, error)
return []api.NodeAddress{{Type: api.NodeLegacyHostIP, Address: ip.String()}}, nil
}
// ExternalID returns the cloud provider ID of the specified instance.
// ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (v *VagrantCloud) ExternalID(instance string) (string, error) {
// Due to vagrant not running with a dedicated DNS setup, we return the IP address of a minion as its hostname at this time
minion, err := v.getInstanceByAddress(instance)
@@ -152,6 +152,11 @@ func (v *VagrantCloud) ExternalID(instance string) (string, error) {
return minion.IP, nil
}
// InstanceID returns the cloud provider ID of the specified instance.
func (v *VagrantCloud) InstanceID(instance string) (string, error) {
return "", nil
}
// saltMinionsByRole filters a list of minions that have a matching role.
func (v *VagrantCloud) saltMinionsByRole(minions []SaltMinion, role string) []SaltMinion {
var filteredMinions []SaltMinion