mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7000: Fix bugs in ListSnapshotPolicy and updateSnapshotPolicy command
(cherry picked from commit 63c4f028971f80a9dfa32125a3eed71468209497)
This commit is contained in:
parent
d64adf5912
commit
1f7a818440
@ -281,8 +281,11 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
|
||||
Boolean display = cmd.getDisplay();
|
||||
|
||||
SnapshotPolicyVO policyVO = _snapshotPolicyDao.findById(id);
|
||||
if(display != null)
|
||||
if(display != null){
|
||||
boolean previousDisplay = policyVO.isDisplay();
|
||||
policyVO.setDisplay(display);
|
||||
_snapSchedMgr.scheduleOrCancelNextSnapshotJobOnDisplayChange(policyVO, previousDisplay);
|
||||
}
|
||||
|
||||
if(customUUID != null)
|
||||
policyVO.setUuid(customUUID);
|
||||
@ -752,7 +755,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
|
||||
result = _snapshotPolicyDao.listAndCountById(id, display, null);
|
||||
if(result != null && result.first() != null && !result.first().isEmpty()){
|
||||
SnapshotPolicyVO snapshotPolicy = result.first().get(0);
|
||||
volumeId = snapshotPolicy.getId();
|
||||
volumeId = snapshotPolicy.getVolumeId();
|
||||
}
|
||||
}
|
||||
VolumeVO volume = _volsDao.findById(volumeId);
|
||||
|
||||
@ -305,9 +305,10 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu
|
||||
return null;
|
||||
}
|
||||
|
||||
// If display attribute is false then remove schedules if any.
|
||||
// If display attribute is false then remove schedules if any and return.
|
||||
if(!policy.isDisplay()){
|
||||
removeSchedule(policy.getVolumeId(), policy.getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
final long policyId = policy.getId();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user