Skip to content

Commit d432997

Browse files
committed
Address bryan's reviews
1 parent 993cc04 commit d432997

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ protected boolean checkIfRestoreSessionFinished(String type, String path) throws
382382
getRestoreVmErrorDescription(StringUtils.substringAfterLast(sessionUid, ":"))));
383383
throw new CloudRuntimeException(String.format("Restore job [%s] failed.", sessionUid));
384384
}
385-
LOG.debug(String.format("Waiting %s seconds, out of a total of %s seconds, for the backup process to finish.", j, restoreTimeout));
385+
LOG.debug(String.format("Waiting %s seconds, out of a total of %s seconds, for the restore backup process to finish.", j, restoreTimeout));
386386

387387
try {
388388
Thread.sleep(1000);
@@ -943,12 +943,12 @@ public Pair<Boolean, String> restoreVMToDifferentLocation(String restorePointId,
943943
}
944944

945945
/**
946-
* Tries to retrieve the error's descripton of the Veeam restore task that errored.
947-
* @param uid Session uid in Veeam of restore process;
948-
* @return the description found in Veeam about the cause of error in restore process.
946+
* Tries to retrieve the error's description of the Veeam restore task that resulted in an error.
947+
* @param uid Session uid in Veeam of the restore process;
948+
* @return the description found in Veeam about the cause of error in the restore process.
949949
*/
950950
protected String getRestoreVmErrorDescription(String uid) {
951-
LOG.debug(String.format("Trying to find cause of error in restore process [%s].", uid));
951+
LOG.debug(String.format("Trying to find the cause of error in the restore process [%s].", uid));
952952
List<String> cmds = Arrays.asList(
953953
String.format("$restoreUid = '%s'", uid),
954954
"$restore = Get-VBRRestoreSession -Id $restoreUid",
@@ -962,7 +962,7 @@ protected String getRestoreVmErrorDescription(String uid) {
962962
if (result != null && result.first()) {
963963
return result.second();
964964
}
965-
return String.format("Failed to get description of failed restore session [%s]. Please contact an administrator.", uid);
965+
return String.format("Failed to get the description of the failed restore session [%s]. Please contact an administrator.", uid);
966966
}
967967

968968
private boolean isLegacyServer() {

plugins/backup/veeam/src/test/java/org/apache/cloudstack/backup/veeam/VeeamClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void getRestoreVmErrorDescriptionTestWhenPowerShellOutputIsNull() {
195195
Mockito.when(mock.getRestoreVmErrorDescription("uuid")).thenCallRealMethod();
196196
Mockito.when(mock.executePowerShellCommands(Mockito.any())).thenReturn(null);
197197
String result = mock.getRestoreVmErrorDescription("uuid");
198-
Assert.assertEquals("Failed to get description of failed restore session [uuid]. Please contact an administrator.", result);
198+
Assert.assertEquals("Failed to get the description of the failed restore session [uuid]. Please contact an administrator.", result);
199199
}
200200

201201
@Test
@@ -204,7 +204,7 @@ public void getRestoreVmErrorDescriptionTestWhenPowerShellOutputIsFalse() {
204204
Mockito.when(mock.getRestoreVmErrorDescription("uuid")).thenCallRealMethod();
205205
Mockito.when(mock.executePowerShellCommands(Mockito.any())).thenReturn(response);
206206
String result = mock.getRestoreVmErrorDescription("uuid");
207-
Assert.assertEquals("Failed to get description of failed restore session [uuid]. Please contact an administrator.", result);
207+
Assert.assertEquals("Failed to get the description of the failed restore session [uuid]. Please contact an administrator.", result);
208208
}
209209

210210

0 commit comments

Comments
 (0)