func FindMachineByIdOrAddress(id string, address string) (Machine, error) {
	coll, err := collection()
	if err != nil {
		return Machine{}, err
	}
	defer coll.Close()
	var result Machine
	query := bson.M{}
	if id != "" {
		query["_id"] = id
	} else {
		query["address"] = address
	}
	err = coll.Find(query).One(&result)
	if err == mgo.ErrNotFound {
		err = ErrMachineNotFound
	}
	return result, err
}
func FindMachineByIdOrAddress(id string, address string) (Machine, error) {
	coll, err := collection()
	if err != nil {
		return Machine{}, err
	}
	defer coll.Close()
	var result Machine
	query := bson.M{}
	if id != "" {
		query["_id"] = id
	} else {
		query["address"] = address
	}
	err = coll.Find(query).One(&result)
	if err == mgo.ErrNotFound {
		err = ErrMachineNotFound
	}
	return result, err
}
func FindMachineByIdOrAddress ( id string , address string ) ( Machine , error ) { coll , err := collection ( ) if err != nil { return Machine { } , err } defer coll . Close ( ) var result Machine query := bson . M { } if id != " " { query [ " " ] = id } else { query [ " " ] = address } err = coll . Find ( query ) . One ( & result ) if err == mgo . ErrNotFound { err = ErrMachineNotFound } return result , err }
// Uses id or address, this is only used because previously we didn't have
// iaas-id in node metadata.
Uses id or address this is only used because previously we didn t have iaas - id in node metadata .