Lior Vernia has uploaded a new change for review. Change subject: webadmin: Only carry on with import if network added ......................................................................
webadmin: Only carry on with import if network added When importing a network from a provider, a sequence of backend commands is triggered; first creation of a network, then attachment to cluster and in the end creation of a default vNIC profile. Previously the succeess of the network creation wasn't verified, leading to confusing errors from the succeeding backend commands. This is fixed here. Change-Id: Ie718f92f724f71e6e9d02ad19e4c7912efe5bb94 Bug-Url: https://bugzilla.redhat.com/1031366 Signed-off-by: Lior Vernia <lver...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/35/22035/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java index 3e74686..7e31dd1 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java @@ -12,6 +12,7 @@ import org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter; import org.ovirt.engine.core.common.action.VdcActionParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.action.VdcReturnValueBase; import org.ovirt.engine.core.common.action.VnicProfileParameters; import org.ovirt.engine.core.common.businessentities.Provider; import org.ovirt.engine.core.common.businessentities.StoragePool; @@ -196,10 +197,13 @@ @Override public void executed(FrontendActionAsyncResult result) { - network.setId((Guid) result.getReturnValue().getActionReturnValue()); + VdcReturnValueBase returnValue = result.getReturnValue(); + if (returnValue != null && returnValue.getSucceeded()) { + network.setId((Guid) returnValue.getActionReturnValue()); - // Perform sequentially: first fetch clusters, then attach network, then create VNIC profile - fetchDcClusters(dcId, network, externalNetwork.isPublicUse()); + // Perform sequentially: first fetch clusters, then attach network, then create VNIC profile + fetchDcClusters(dcId, network, externalNetwork.isPublicUse()); + } } }); } -- To view, visit http://gerrit.ovirt.org/22035 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie718f92f724f71e6e9d02ad19e4c7912efe5bb94 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Lior Vernia <lver...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches