From fd9577f5928195dae0ecbca4d5e595007dc14b18 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 25 Sep 2023 16:22:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20aristia=20platform=20detec?= =?UTF-8?q?tion=20to=20include=20version=20and=20arch=20(#1917)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/arista/provider/provider.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/providers/arista/provider/provider.go b/providers/arista/provider/provider.go index 3f9dd82b54..c698e08bbc 100644 --- a/providers/arista/provider/provider.go +++ b/providers/arista/provider/provider.go @@ -164,11 +164,21 @@ func (s *Service) detect(asset *inventory.Asset, conn *connection.AristaConnecti asset.Id = conn.Conf.Type asset.Name = conn.Conf.Host + version := "" + arch := "" + aristaVersion, err := conn.GetVersion() + if err == nil { + version = aristaVersion.Version + arch = aristaVersion.Architecture + } + asset.Platform = &inventory.Platform{ - Name: "arista", - Family: []string{"arista"}, - Kind: "api", - Title: "Arista EOS", + Name: "arista-eos", + Version: version, + Arch: arch, + Family: []string{"arista"}, + Kind: "api", + Title: "Arista EOS", } id, err := conn.Identifier()