Vered Volansky has posted comments on this change.

Change subject: core: Fix run VM with locked disk msg
......................................................................


Patch Set 5: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
Line 512:         }
Line 513:         return returnValue;
Line 514:     }
Line 515: 
Line 516:     private static void addDiskLockedMessage(List<String> 
lockedDisksAliases, List<String> messages)
There was only one message for both not so long ago and it was changed to this. 
I agree it's tedious to maintain, but I'm not sure I should just expunge 
another patch.
Line 517:     {
Line 518:         int numOfDisks = lockedDisksAliases.size();
Line 519:         if (numOfDisks > 0)
Line 520:         {


Line 521:             VdcBllMessages message = (numOfDisks == 1 ? 
VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED :
Line 522:                     
VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ARE_LOCKED);
Line 523:             ListUtils.nullSafeAdd(messages, message.toString());
Line 524: 
Line 525:             String aliases = (numOfDisks == 1 ? "diskAlias" : 
"diskAliases");
I saw that one coming...
I actually am a fan, and did see the problem with the two in a row. It wasn't 
my first try, and the code looked a lot more dirty in my opinion when I did it 
as you suggest.
Line 526:             messages.add(String.format("$%1$s %2$s", aliases, 
StringUtils.join(lockedDisksAliases, ", ")));
Line 527:         }
Line 528:     }
Line 529: 


--
To view, visit http://gerrit.ovirt.org/8693
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7c56d9d2926eaf34b4a279c8d61a8cb166524da9
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to