peer rpc: Fix typo in cluster credentials update (#3579)

Update credentials in cluster wasn't working due to a typo
This commit is contained in:
Anis Elleuch 2017-01-14 23:06:23 +01:00 committed by Harshavardhana
parent 50796e481d
commit 2959c104b3

View File

@ -108,7 +108,7 @@ func updateCredsOnPeers(creds credential) map[string]error {
serverAddr: peers[ix],
secureConn: globalIsSSL,
serviceEndpoint: path.Join(reservedBucket, browserPeerPath),
serviceName: "Browser",
serviceName: "BrowserPeer",
})
// Construct RPC call arguments.
@ -116,14 +116,14 @@ func updateCredsOnPeers(creds credential) map[string]error {
// Make RPC call - we only care about error
// response and not the reply.
err := client.Call("Browser.SetAuthPeer", &args, &AuthRPCReply{})
err := client.Call("BrowserPeer.SetAuthPeer", &args, &AuthRPCReply{})
// We try a bit hard (3 attempts with 1 second delay)
// to set creds on peers in case of failure.
if err != nil {
for i := 0; i < 2; i++ {
time.Sleep(1 * time.Second) // 1 second delay.
err = client.Call("Browser.SetAuthPeer", &args, &AuthRPCReply{})
err = client.Call("BrowserPeer.SetAuthPeer", &args, &AuthRPCReply{})
if err == nil {
break
}