From e4d1a7a21f4d09a1ee2a0b3db6dbddbdf5d95d74 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Thu, 21 Feb 2019 11:02:37 +0800 Subject: [PATCH] fix: build broken for changing GetNetworkOfIP to GetOnPremiseNetworkOfIP --- pkg/dns/parse.go | 2 +- pkg/util/openstack/shell/instance.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/dns/parse.go b/pkg/dns/parse.go index 568a773567..1db458494f 100644 --- a/pkg/dns/parse.go +++ b/pkg/dns/parse.go @@ -36,7 +36,7 @@ func parseRequest(state request.Request) (r *recordRequest, err error) { if guest := models.GuestnetworkManager.GetGuestByAddress(srcIP); guest != nil { r.srcProjectId = guest.ProjectId r.srcInCloud = true - } else if network, _ := models.NetworkManager.GetNetworkOfIP(srcIP, "", tristate.None); network != nil { + } else if network, _ := models.NetworkManager.GetOnPremiseNetworkOfIP(srcIP, "", tristate.None); network != nil { r.srcProjectId = network.ProjectId r.srcInCloud = true } diff --git a/pkg/util/openstack/shell/instance.go b/pkg/util/openstack/shell/instance.go index 0d1663045e..3e5289cd35 100644 --- a/pkg/util/openstack/shell/instance.go +++ b/pkg/util/openstack/shell/instance.go @@ -58,7 +58,11 @@ func init() { } shellutils.R(&InstanceChangeConfigOptions{}, "instance-change-config", "Change instance config", func(cli *openstack.SRegion, args *InstanceChangeConfigOptions) error { - return cli.ChageConfig(args.ID, args.FLAVOR_ID) + instance, err := cli.GetInstance(args.ID) + if err != nil { + return err + } + return cli.ChangeConfig(instance, args.FLAVOR_ID) }) }