Merge pull request #1088 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-fix-build-error-20180221 to release/2.6.0

* commit 'e4d1a7a21f4d09a1ee2a0b3db6dbddbdf5d95d74':
  fix: build broken for changing GetNetworkOfIP to GetOnPremiseNetworkOfIP
This commit is contained in:
李泽玺
2019-02-21 11:05:12 +08:00
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)
})
}