Skip to content

Commit 9fb2005

Browse files
Fixed avoid set variables which is causing deployment failures (#7372)
1 parent 9e1c7a2 commit 9fb2005

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,11 +1576,11 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
15761576

15771577
// for each volume find list of suitable storage pools by calling the
15781578
// allocators
1579-
Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
1580-
if (originalAvoidPoolSet == null) {
1581-
originalAvoidPoolSet = new HashSet<Long>();
1579+
Set<Long> originalAvoidPoolSet = new HashSet<>();
1580+
if (avoid.getPoolsToAvoid() != null) {
1581+
originalAvoidPoolSet.addAll(avoid.getPoolsToAvoid());
15821582
}
1583-
Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
1583+
Set<Long> poolsToAvoidOutput = new HashSet<>(originalAvoidPoolSet);
15841584

15851585
for (VolumeVO toBeCreated : volumesTobeCreated) {
15861586
s_logger.debug("Checking suitable pools for volume (Id, Type): (" + toBeCreated.getId() + "," + toBeCreated.getVolumeType().name() + ")");
@@ -1657,12 +1657,6 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
16571657

16581658
DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
16591659

1660-
//FR123 check how is it different for service offering getTagsArray and disk offering's
1661-
//if ((vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO || toBeCreated.getVolumeType() == Volume.Type.ROOT)
1662-
// && vmProfile.getServiceOffering().getTagsArray().length != 0) {
1663-
// diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
1664-
//}
1665-
16661660
DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
16671661
boolean useLocalStorage = false;
16681662
if (vmProfile.getType() != VirtualMachine.Type.User) {

0 commit comments

Comments
 (0)