Moti Asayag has posted comments on this change.
Change subject: engine: Add Label/Unlabel Nic commands
......................................................................
Patch Set 8:
(6 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/LabelNicCommand.java
Line 58:
Line 59: @Override
Line 60: protected boolean canDoAction() {
Line 61: if (getNic() == null) {
Line 62: return
failCanDoAction(VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS);
here goes meaningful naming convention... :S
Line 63: }
Line 64:
Line 65: if (getNic().getLabels() != null &&
getNic().getLabels().contains(getParameters().getLabel())) {
Line 66: return
failCanDoAction(VdcBllMessages.INTERFACE_ALREADY_LABELED);
Line 91:
Line 92: return nic;
Line 93: }
Line 94:
Line 95: public String getNickName() {
if the nic is null, the command will fail due to permission mechanism.
If permission mechanism won't block it, than can-do-action will.
So we're safe here.
Line 96: return getNic().getName();
Line 97: }
Line 98:
Line 99: public String getLabel() {
Line 131:
Line 132: nicToConfigure.getLabels().add(label);
Line 133: }
Line 134:
Line 135: public Set<Network>
getNetworksToConfigure(List<VdsNetworkInterface> nics, List<Network>
labeledNetworks) {
yes, if there are networks which already provisioned on other nics, i don't
intend to reconfigure.
This should be indicated to the user via the setup networks dialog, and will
require a manual intervention.
Line 136: Map<String, VdsNetworkInterface> nicsByNetworkName =
Entities.hostInterfacesByNetworkName(nics);
Line 137: Set<Network> networkToAdd = new HashSet<>();
Line 138:
Line 139: for (Network network : labeledNetworks) {
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/UnlabelNicCommand.java
Line 71: }
Line 72:
Line 73: @Override
Line 74: protected List<Class<?>> getValidationGroups() {
Line 75: addValidationGroup(CreateEntity.class);
Done
Line 76: return super.getValidationGroups();
Line 77: }
Line 78:
Line 79: private VdsNetworkInterface getNic() {
Line 84: return nic;
Line 85: }
Line 86:
Line 87: public String getNickName() {
Line 88: return getNic().getName();
same response ;-)
Line 89: }
Line 90:
Line 91: public String getLabel() {
Line 92: return getParameters().getLabel();
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
Line 425: NO_ACTIVE_ISO_DOMAIN_IN_DATA_CENTER(5028),
Line 426: PROVIDER_FAILURE(5050),
Line 427: PROVIDER_IMPORT_CERTIFICATE_CHAIN_ERROR(5051),
Line 428: PROVIDER_SSL_FAILURE(5052),
Line 429: NETWORK_LABEL_CONFLICT(5053),
Done
Line 430:
Line 431: // Gluster errors
Line 432: NO_UP_SERVER_FOUND(7000),
Line 433: // error to indicate backend does not recognize the session
--
To view, visit http://gerrit.ovirt.org/22870
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I73a76c66f4f4c1be2aa59952c50cc9829633d572
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches