mirror of
https://github.com/minio/minio.git
synced 2025-01-24 13:13:16 -05:00
AddNode fails with proper error code when bucketid is malformed
This commit is contained in:
parent
8cf66ede66
commit
70a2217eb2
@ -23,12 +23,10 @@ func (b donutBucket) GetNodes() ([]string, error) {
|
|||||||
|
|
||||||
// AddNode - adds a node to a bucket
|
// AddNode - adds a node to a bucket
|
||||||
func (b donutBucket) AddNode(nodeID, bucketID string) error {
|
func (b donutBucket) AddNode(nodeID, bucketID string) error {
|
||||||
|
errParams := map[string]string{"node": nodeID, "bucketID": bucketID}
|
||||||
tokens := strings.Split(bucketID, ":")
|
tokens := strings.Split(bucketID, ":")
|
||||||
if len(tokens) != 3 {
|
if len(tokens) != 3 {
|
||||||
var err error
|
return iodine.Error(errors.New("Bucket ID malformeD: "+bucketID), errParams)
|
||||||
err = iodine.Error(nil, nil)
|
|
||||||
return err
|
|
||||||
// return iodine.Error(errors.New("Bucket ID malformed: "+bucketID), map[string]string{"nodeID": nodeID, "bucketID": bucketID})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// bucketName := tokens[0]
|
// bucketName := tokens[0]
|
||||||
@ -36,7 +34,7 @@ func (b donutBucket) AddNode(nodeID, bucketID string) error {
|
|||||||
// aggregate := "0"
|
// aggregate := "0"
|
||||||
part, err := strconv.Atoi(tokens[2])
|
part, err := strconv.Atoi(tokens[2])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return iodine.Error(errors.New("Part malformed: "+tokens[2]), map[string]string{"nodeID": nodeID, "bucketID": bucketID})
|
return iodine.Error(errors.New("Part malformed: "+tokens[2]), errParams)
|
||||||
}
|
}
|
||||||
b.nodes[part] = nodeID
|
b.nodes[part] = nodeID
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user