@ -17,6 +17,7 @@
package cmd
package cmd
import (
import (
"encoding/json"
"fmt"
"fmt"
"path"
"path"
"sync"
"sync"
@ -213,7 +214,12 @@ func S3PeersUpdateBucketListener(bucket string, lcfg []listenerConfig) {
// S3PeersUpdateBucketPolicy - Sends update bucket policy request to
// S3PeersUpdateBucketPolicy - Sends update bucket policy request to
// all peers. Currently we log an error and continue.
// all peers. Currently we log an error and continue.
func S3PeersUpdateBucketPolicy ( bucket string , pCh policyChange ) {
func S3PeersUpdateBucketPolicy ( bucket string , pCh policyChange ) {
setBPPArgs := & SetBPPArgs { Bucket : bucket , PCh : pCh }
byts , err := json . Marshal ( pCh )
if err != nil {
errorIf ( err , "Failed to marshal policyChange - this is a BUG!" )
return
}
setBPPArgs := & SetBPPArgs { Bucket : bucket , PChBytes : byts }
peers := globalS3Peers . GetPeers ( )
peers := globalS3Peers . GetPeers ( )
errsMap := globalS3Peers . SendRPC ( peers , "S3.SetBucketPolicyPeer" , setBPPArgs )
errsMap := globalS3Peers . SendRPC ( peers , "S3.SetBucketPolicyPeer" , setBPPArgs )
for peer , err := range errsMap {
for peer , err := range errsMap {