Skip to content

Commit 6e72678

Browse files
harikrishna-patnalakishankavala
authored andcommitted
Fixed avoid set variables which is causing deployment failures (apache#7372)
1 parent 9e4f3a1 commit 6e72678

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

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

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

16431643
// for each volume find list of suitable storage pools by calling the
16441644
// allocators
1645-
Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
1646-
if (originalAvoidPoolSet == null) {
1647-
originalAvoidPoolSet = new HashSet<Long>();
1645+
Set<Long> originalAvoidPoolSet = new HashSet<>();
1646+
if (avoid.getPoolsToAvoid() != null) {
1647+
originalAvoidPoolSet.addAll(avoid.getPoolsToAvoid());
16481648
}
1649-
Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
1649+
Set<Long> poolsToAvoidOutput = new HashSet<>(originalAvoidPoolSet);
16501650

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

17241724
DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
17251725

1726-
//FR123 check how is it different for service offering getTagsArray and disk offering's
1727-
//if ((vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO || toBeCreated.getVolumeType() == Volume.Type.ROOT)
1728-
// && vmProfile.getServiceOffering().getTagsArray().length != 0) {
1729-
// diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
1730-
//}
1731-
17321726
DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
17331727
boolean useLocalStorage = false;
17341728
if (vmProfile.getType() != VirtualMachine.Type.User) {

0 commit comments

Comments
 (0)