@@ -219,19 +219,19 @@ func (c *CConfigApplication) Expel(ctx ExpelCtx) error {
219219 }
220220
221221 var instances []running.InstanceCtx
222- var unfound []string
222+ var unavailable []string
223223 for _ , inst := range targetReplicaset .Instances {
224224 if ! inst .InstanceCtxFound {
225225 if inst .Alias != ctx .InstName {
226226 // The target instance could be offline.
227- unfound = append (unfound , inst .Alias )
227+ unavailable = append (unavailable , inst .Alias )
228228 }
229229 } else {
230230 instances = append (instances , inst .InstanceCtx )
231231 }
232232 }
233- if len (unfound ) > 0 {
234- msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unfound , "," ))
233+ if len (unavailable ) > 0 {
234+ msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unavailable , "," ))
235235 if ! ctx .Force {
236236 return fmt .Errorf (
237237 "all other instances in the target replicaset should be online, %s" , msg )
@@ -367,16 +367,16 @@ func (c *CConfigApplication) Promote(ctx PromoteCtx) error {
367367 }
368368
369369 var instances []running.InstanceCtx
370- var unfound []string
370+ var unavailable []string
371371 for _ , inst := range targetReplicaset .Instances {
372372 if ! inst .InstanceCtxFound {
373- unfound = append (unfound , inst .Alias )
373+ unavailable = append (unavailable , inst .Alias )
374374 } else {
375375 instances = append (instances , inst .InstanceCtx )
376376 }
377377 }
378- if len (unfound ) > 0 {
379- msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unfound , "," ))
378+ if len (unavailable ) > 0 {
379+ msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unavailable , "," ))
380380 if ! ctx .Force {
381381 return fmt .Errorf ("all instances in the target replicaset should be online, %s" , msg )
382382 }
@@ -406,16 +406,16 @@ func (c *CConfigApplication) Demote(ctx DemoteCtx) error {
406406 }
407407
408408 var instances []running.InstanceCtx
409- var unfound []string
409+ var unavailable []string
410410 for _ , inst := range targetReplicaset .Instances {
411411 if ! inst .InstanceCtxFound {
412- unfound = append (unfound , inst .Alias )
412+ unavailable = append (unavailable , inst .Alias )
413413 } else {
414414 instances = append (instances , inst .InstanceCtx )
415415 }
416416 }
417- if len (unfound ) > 0 {
418- msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unfound , "," ))
417+ if len (unavailable ) > 0 {
418+ msg := fmt .Sprintf ("could not connect to: %s" , strings .Join (unavailable , "," ))
419419 if ! ctx .Force {
420420 return fmt .Errorf ("all instances in the target replicaset should be online, %s" , msg )
421421 }
@@ -486,8 +486,8 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
486486 }
487487
488488 var (
489- instances []running.InstanceCtx
490- unfound []string
489+ instances []running.InstanceCtx
490+ unavailable []string
491491 )
492492
493493 if ctx .InstName != "" {
@@ -501,7 +501,7 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
501501 }
502502 for _ , inst := range targetReplicaset .Instances {
503503 if ! inst .InstanceCtxFound {
504- unfound = append (unfound , inst .Alias )
504+ unavailable = append (unavailable , inst .Alias )
505505 continue
506506 }
507507 instances = append (instances , inst .InstanceCtx )
@@ -510,15 +510,15 @@ func (c *CConfigApplication) RolesChange(ctx RolesChangeCtx,
510510 for _ , r := range c .replicasets .Replicasets {
511511 for _ , i := range r .Instances {
512512 if ! i .InstanceCtxFound {
513- unfound = append (unfound , i .Alias )
513+ unavailable = append (unavailable , i .Alias )
514514 continue
515515 }
516516 instances = append (instances , i .InstanceCtx )
517517 }
518518 }
519519 }
520- if len (unfound ) > 0 {
521- msg := "could not connect to: " + strings .Join (unfound , "," )
520+ if len (unavailable ) > 0 {
521+ msg := "could not connect to: " + strings .Join (unavailable , "," )
522522 if ! ctx .Force {
523523 return fmt .Errorf ("all instances in the target replicaset should be online, %s" , msg )
524524 }
0 commit comments