From cab68198a0b3ddca64b8aa164586add399e15d68 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 29 Mar 2019 21:59:06 +0800 Subject: [PATCH] feature: host add property server_ips that carries the ip list of baremetal server --- pkg/compute/models/hosts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 132f5cc6e4..3271868a99 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -2180,6 +2180,9 @@ func (self *SHost) getMoreDetails(ctx context.Context, extra *jsonutils.JSONDict if server != nil { extra.Add(jsonutils.NewString(server.Id), "server_id") extra.Add(jsonutils.NewString(server.Name), "server") + if self.HostType == HOST_TYPE_BAREMETAL { + extra.Add(jsonutils.NewString(strings.Join(server.getRealIPs(), ",")), "server_ips") + } } netifs := self.GetNetInterfaces() if netifs != nil && len(netifs) > 0 {