fix: build broken for changing GetNetworkOfIP to GetOnPremiseNetworkOfIP

This commit is contained in:
Qiu Jian
2019-02-21 11:02:37 +08:00
parent 50d4e47869
commit e4d1a7a21f
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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
}
+5 -1
View File
@@ -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)
})
}