Allon Mureinik has posted comments on this change.
Change subject: engine: check if host exists with same name
......................................................................
Patch Set 6: (6 inline comments)
minor issues, see inline
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RegisterVdsQuery.java
Line 357: getParameters().getVdsHostName());
Line 358: int lastIteratedIndex = 1;
Line 359: if (vds_byHostName != null) {
Line 360: log.debugFormat(
Line 361: "RegisterVdsQuery::HandleOldVdssWithSameHostName
- found VDS with the same host name {1}. Will try to change their hostname to
a different value",
you removed {0} - so this now should be {0}
Line 362: vds_byHostName,
Line 363: getParameters().getVdsHostName());
Line 364:
Line 365: if (vdsByUniqueId == null
Line 359: if (vds_byHostName != null) {
Line 360: log.debugFormat(
Line 361: "RegisterVdsQuery::HandleOldVdssWithSameHostName
- found VDS with the same host name {1}. Will try to change their hostname to
a different value",
Line 362: vds_byHostName,
Line 363: getParameters().getVdsHostName());
and this should be removed
Line 364:
Line 365: if (vdsByUniqueId == null
Line 366: || (vdsByUniqueId != null &&
!vds_byHostName.getId().equals(vdsByUniqueId.getId()))) {
Line 367: boolean unique = false;
Line 380: UpdateVdsActionParameters parameters = new
UpdateVdsActionParameters(
Line 381: vds_byHostName.getStaticData(), "",
false);
Line 382: parameters.setShouldBeLogged(false);
Line 383:
parameters.setTransactionScopeOption(TransactionScopeOption.RequiresNew);
Line 384: VdcReturnValueBase ret =
something looks funky with the indentation here.
Is it just gerrit?
Line 385:
Backend.getInstance().runInternalAction(VdcActionType.UpdateVds, parameters);
Line 386:
Line 387: if (ret == null || !ret.getSucceeded()) {
Line 388: error =
AuditLogType.VDS_REGISTER_ERROR_UPDATING_HOST;
Line 434: boolean hostExistInDB = hostToRegister != null;
Line 435:
Line 436: if (host != null) {
Line 437: log.debugFormat(
Line 438: "found a VDS with the same name {1}. Will try to
register with a new name",
should be {0}
Line 439: getParameters().getVdsName());
Line 440:
Line 441: String nameToRegister = getParameters().getVdsName();
Line 442: String uniqueIdToRegister =
getParameters().getVdsUniqueId();
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java
Line 36: */
Line 37: VDS get(NGuid id, Guid userID, boolean isFiltered);
Line 38:
Line 39: /**
Line 40: * Get the VDS by it's name.
s/it's/its/
Line 41: *
Line 42: * @param name the name of the VDS
Line 43: * @return the VDS if found, or null if not found
Line 44: */
....................................................
File
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VdsDAOTest.java
Line 127: public void testByHostname() {
Line 128: VDS result = dao.getByHostname(existingVds.gethost_name());
Line 129:
Line 130: assertNotNull(result);
Line 131: assertFalse(result == null);
This is redundant - it's the same as asserNotNull you have in the previous line
Line 132: assertEquals(existingVds.gethost_name(),
result.gethost_name());
Line 133: }
Line 134:
Line 135: /**
--
To view, visit http://gerrit.ovirt.org/10910
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4791d49b128126269d9b2b0c2e9bb35debf5a7ec
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches