SadiJr commented on a change in pull request #5455:
URL: https://github.com/apache/cloudstack/pull/5455#discussion_r713863393



##########
File path: 
plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java
##########
@@ -616,18 +633,20 @@ public boolean deleteJobAndBackup(final String jobName) {
     public List<Backup.RestorePoint> listRestorePoints(String backupName, 
String vmInternalName) {
         final List<String> cmds = Arrays.asList(
                 String.format("$backup = Get-VBRBackup -Name \"%s\"", 
backupName),
-                String.format("if ($backup) { (Get-VBRRestorePoint 
-Backup:$backup -Name \"%s\" ^| Where-Object {$_.IsConsistent -eq $true}) }", 
vmInternalName)
+                String.format("if ($backup) { $restore = (Get-VBRRestorePoint 
-Backup:$backup -Name \"%s\" ^| Where-Object {$_.IsConsistent -eq $true})", 
vmInternalName),
+                "if ($restore) { $restore ^| Format-List } }"
         );
         Pair<Boolean, String> response = executePowerShellCommands(cmds);
         final List<Backup.RestorePoint> restorePoints = new ArrayList<>();
         if (response == null || !response.first()) {
-            LOG.debug("Veeam restore point listing failed due to: " + 
(response != null ? response.second() : "no powershell output returned"));
             return restorePoints;
         }
+
         for (final String block : response.second().split("\r\n\r\n")) {
             if (block.isEmpty()) {
                 continue;
             }
+            LOG.debug(String.format("Found restore points from [backupName: 
%s, vmInternalName: %s] with is: [%s].", backupName, vmInternalName, block));

Review comment:
       Done, thanks.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to