@@ -280,23 +280,23 @@ func (curveadm *CurveAdm) ClusterPoolData() string { return curveadm.c
280280func (curveadm * CurveAdm ) ClusterType () string { return curveadm .clusterType }
281281func (curveadm * CurveAdm ) Monitor () storage.Monitor { return curveadm .monitor }
282282
283- func (curveadm * CurveAdm ) GetHost (host string ) (* hosts.HostConfig , error ) {
283+ func (curveadm * CurveAdm ) GetHost (name string ) (* hosts.HostConfig , error ) {
284284 if len (curveadm .Hosts ()) == 0 {
285285 return nil , errno .ERR_HOST_NOT_FOUND .
286- F ("host: %s" , host )
286+ F ("host: %s" , name )
287287 }
288288 hcs , err := hosts .ParseHosts (curveadm .Hosts ())
289289 if err != nil {
290290 return nil , err
291291 }
292292
293293 for _ , hc := range hcs {
294- if hc .GetHost () == host {
294+ if hc .GetName () == name {
295295 return hc , nil
296296 }
297297 }
298298 return nil , errno .ERR_HOST_NOT_FOUND .
299- F ("host: %s" , host )
299+ F ("host: %s" , name )
300300}
301301
302302func (curveadm * CurveAdm ) ParseTopologyData (data string ) ([]* topology.DeployConfig , error ) {
@@ -306,7 +306,7 @@ func (curveadm *CurveAdm) ParseTopologyData(data string) ([]*topology.DeployConf
306306 return nil , err
307307 }
308308 for _ , hc := range hcs {
309- ctx .Add (hc .GetHost (), hc .GetHostname ())
309+ ctx .Add (hc .GetName (), hc .GetHostname ())
310310 }
311311
312312 dcs , err := topology .ParseTopology (data , ctx )
@@ -466,7 +466,7 @@ func (curveadm *CurveAdm) DiffTopology(data1, data2 string) ([]topology.Topology
466466 return nil , err
467467 }
468468 for _ , hc := range hcs {
469- ctx .Add (hc .GetHost (), hc .GetHostname ())
469+ ctx .Add (hc .GetName (), hc .GetHostname ())
470470 }
471471
472472 if len (data1 ) == 0 {
0 commit comments