cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1740: CLOUDSTACK-9572 Snapshot on primary storage n...
Date Mon, 14 Nov 2016 23:03:29 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1740#discussion_r87913074
  
    --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ---
    @@ -1111,6 +1111,20 @@ public boolean canOperateOnVolume(Volume volume) {
         }
     
         @Override
    +    public void cleanupSnapshotsByVolume(Long volumeId) {
    +        List<SnapshotVO> volSnapShots = _snapshotDao.listByVolumeId(volumeId);
    +        for(SnapshotVO snapshot: volSnapShots) {
    +            SnapshotInfo info = snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary);
    +            try {
    +                snapshotSrv.deleteSnapshot(info);
    +            } catch(CloudRuntimeException e) {
    +                String msg = "Cleanup of Snapshot with uuid " + snapshot.getUuid() +
" in primary storage is failed. Ignoring";
    --- End diff --
    
    This local variable is only used once.  Please consider collapsing into lint 1122.  Also,
please add the message from the exception to the message to provide greater detail for debugging
efforts.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message