From 19a4e9dd50e4333b2751d7309389b83b8e16118d Mon Sep 17 00:00:00 2001 From: SadiJr Date: Mon, 12 Dec 2022 04:16:30 -0300 Subject: [PATCH] veeam: Fix escape powershell comand when listing Veeam repository names (#6943) PR #5774 introduced a functionality to allow operators to choose in which Veeam's repository, if more than one is configured, ACS' clone job will be executed. However, a change was missing in the PR and caused the errors reported in #6599. This PR addresses the fix for #6599. Co-authored-by: SadiJr --- .../java/org/apache/cloudstack/backup/veeam/VeeamClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java b/plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java index 39f3b5e44da..e0f55f7d47e 100644 --- a/plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java +++ b/plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java @@ -369,7 +369,7 @@ public class VeeamClient { protected String getRepositoryNameFromJob(String backupName) { final List cmds = Arrays.asList( String.format("$Job = Get-VBRJob -name \"%s\"", backupName), - "$Job.GetBackupTargetRepository() ^| select Name | Format-List" + "$Job.GetBackupTargetRepository() ^| select Name ^| Format-List" ); Pair result = executePowerShellCommands(cmds); if (result == null || !result.first()) { @@ -717,4 +717,4 @@ public class VeeamClient { } return new Pair<>(result.first(), restoreLocation); } -} \ No newline at end of file +}