Fixed avoid set variables which is causing deployment failures (#7372)

This commit is contained in:
Harikrishna 2023-03-29 20:44:18 +05:30 committed by GitHub
parent 9e1c7a2a90
commit 9fb20056d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 10 deletions

View File

@ -1576,11 +1576,11 @@ StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
// for each volume find list of suitable storage pools by calling the
// allocators
Set<Long> originalAvoidPoolSet = avoid.getPoolsToAvoid();
if (originalAvoidPoolSet == null) {
originalAvoidPoolSet = new HashSet<Long>();
Set<Long> originalAvoidPoolSet = new HashSet<>();
if (avoid.getPoolsToAvoid() != null) {
originalAvoidPoolSet.addAll(avoid.getPoolsToAvoid());
}
Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet);
Set<Long> poolsToAvoidOutput = new HashSet<>(originalAvoidPoolSet);
for (VolumeVO toBeCreated : volumesTobeCreated) {
s_logger.debug("Checking suitable pools for volume (Id, Type): (" + toBeCreated.getId() + "," + toBeCreated.getVolumeType().name() + ")");
@ -1657,12 +1657,6 @@ StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
//FR123 check how is it different for service offering getTagsArray and disk offering's
//if ((vmProfile.getTemplate().getFormat() == Storage.ImageFormat.ISO || toBeCreated.getVolumeType() == Volume.Type.ROOT)
// && vmProfile.getServiceOffering().getTagsArray().length != 0) {
// diskOffering.setTagsArray(Arrays.asList(vmProfile.getServiceOffering().getTagsArray()));
//}
DiskProfile diskProfile = new DiskProfile(toBeCreated, diskOffering, vmProfile.getHypervisorType());
boolean useLocalStorage = false;
if (vmProfile.getType() != VirtualMachine.Type.User) {