Roy Golan has posted comments on this change.
Change subject: core, webadmin: Cluster and architecture related validations
......................................................................
Patch Set 12:
(8 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ChangeVDSClusterCommand.java
Line 100: if (vds.getCpuName() == null) {
Line 101: return
failCanDoAction(VdcBllMessages.CPU_TYPE_UNSUPPORTED_IN_THIS_CLUSTER_VERSION);
Line 102: }
Line 103:
Line 104: if
(!getTargetCluster().getArchitecture().equals(ArchitectureType.undefined) &&
pls use
(getTargetCluster().getArchitecture() != ArchitectureType.undefined &&
getTargetCluster().getAchitecture() != vds.getCpuName().getArchitechure())
Line 105:
!getTargetCluster().getArchitecture().equals(vds.getCpuName().getArchitecture()))
{
Line 106: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_CLUSTER_DIFFERENT_ARCHITECTURES);
Line 107: }
Line 108:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommand.java
Line 145: protected boolean canDoAction() {
Line 146: boolean result = true;
Line 147: boolean hasVms = false;
Line 148: boolean hasVmOrHost = false;
Line 149:
pls remove the extra lines here
Line 150: boolean sameCpuNames = false;
Line 151:
Line 152: List<VM> vmList = null;
Line 153:
Line 208: vmList = getVmDAO().getAllForVdsGroup(oldGroup.getId());
Line 209: hasVmOrHost = !vmList.isEmpty() ||
!allForVdsGroup.isEmpty();
Line 210: }
Line 211:
Line 212: // cannot change the the processor architecture while there
are attached hosts and VMs to the cluster
"hosts or VMs"
Line 213: if (result && getVdsGroup().supportsVirtService()
Line 214: && !isArchitectureChangeable()
Line 215: && hasVmOrHost) {
Line 216:
addCanDoActionMessage(VdcBllMessages.VDS_GROUP_CANNOT_UPDATE_CPU_ARCHITECTURE_ILLEGAL);
Line 209: hasVmOrHost = !vmList.isEmpty() ||
!allForVdsGroup.isEmpty();
Line 210: }
Line 211:
Line 212: // cannot change the the processor architecture while there
are attached hosts and VMs to the cluster
Line 213: if (result && getVdsGroup().supportsVirtService()
nice check. gluster is really not interesting here.
Line 214: && !isArchitectureChangeable()
Line 215: && hasVmOrHost) {
Line 216:
addCanDoActionMessage(VdcBllMessages.VDS_GROUP_CANNOT_UPDATE_CPU_ARCHITECTURE_ILLEGAL);
Line 217: result = false;
Line 224: if (result) {
Line 225: boolean isOldCPUEmpty =
StringUtils.isEmpty(oldGroup.getcpu_name());
Line 226:
Line 227: if (!isOldCPUEmpty && !sameCpuNames &&
!isCpuUpdatable(oldGroup) && hasVmOrHost )
Line 228: {
pls move open curly bracket at the end of line
Line 229:
addCanDoActionMessage(VdcBllMessages.VDS_GROUP_CPU_IS_NOT_UPDATABLE);
Line 230: result = false;
Line 231: }
Line 232: }
Line 360: addCanDoActionMessage(VdcBllMessages.VAR__TYPE__CLUSTER);
Line 361: addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE);
Line 362: }
Line 363:
Line 364: protected boolean isArchitectureChangeable() {
pls change the name from Changeable to isArchitectureUpdateable to fit the
standard. (isCpuUpdateable, UpdateVdsGroupCommand etc..)
Line 365: if
(oldGroup.getArchitecture().equals(ArchitectureType.undefined)) {
Line 366: return true;
Line 367: }
Line 368:
Line 361: addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE);
Line 362: }
Line 363:
Line 364: protected boolean isArchitectureChangeable() {
Line 365: if
(oldGroup.getArchitecture().equals(ArchitectureType.undefined)) {
pls use ==
Line 366: return true;
Line 367: }
Line 368:
Line 369: return getArchitecture().equals(oldGroup.getArchitecture());
Line 365: if
(oldGroup.getArchitecture().equals(ArchitectureType.undefined)) {
Line 366: return true;
Line 367: }
Line 368:
Line 369: return getArchitecture().equals(oldGroup.getArchitecture());
infact this whole block is inter-changeable with -
return oldGroup.getArch() == Architecture.undifined ? true : getArchitecture()
== oldGroup.getArch()
Line 370: }
Line 371:
Line 372: protected boolean checkIfCpusSameManufacture(VDSGroup group) {
Line 373: return
CpuFlagsManagerHandler.CheckIfCpusSameManufacture(group.getcpu_name(),
--
To view, visit http://gerrit.ovirt.org/18226
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If19c3ee99f5ef17721bb4111ddfb48977d1b578b
Gerrit-PatchSet: 12
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa
<[email protected]>
Gerrit-Reviewer: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Martin Betak <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Tomáš Došek <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [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