From 0ae246f01d53da61804d9af43e2bb4fba103684d Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Wed, 2 Mar 2022 18:57:02 +0800 Subject: [PATCH] fix: host update sn --- cmd/climc/shell/compute/hosts.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/climc/shell/compute/hosts.go b/cmd/climc/shell/compute/hosts.go index 3a54baf808..6135428f04 100644 --- a/cmd/climc/shell/compute/hosts.go +++ b/cmd/climc/shell/compute/hosts.go @@ -161,6 +161,8 @@ func init() { IpmiUsername string `help:"IPMI user"` IpmiPassword string `help:"IPMI password"` IpmiIpAddr string `help:"IPMI ip_addr"` + + Sn string `help:"serial number"` } R(&HostUpdateOptions{}, "host-update", "Update information of a host", func(s *mcclient.ClientSession, args *HostUpdateOptions) error { params := jsonutils.NewDict() @@ -200,6 +202,9 @@ func init() { if len(args.IpmiIpAddr) > 0 { params.Add(jsonutils.NewString(args.IpmiIpAddr), "ipmi_ip_addr") } + if len(args.Sn) > 0 { + params.Add(jsonutils.NewString(args.Sn), "sn") + } if params.Size() == 0 { return fmt.Errorf("Not data to update") }