Skip to content

Commit

Permalink
Merge pull request #844 from DataVault/DS-LUC070-147-20241119
Browse files Browse the repository at this point in the history
DS- LUC070-147-20241119 Remove TSM delete functionality
  • Loading branch information
dspeed2 authored Nov 20, 2024
2 parents a3eb1c7 + 0c36eca commit 592ebad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ public Verify.Method getVerifyMethod() {
public void delete(String depositId, File working, Progress progress, String optFilePath) throws Exception {
Path depositDirectoryPath = getDepositDirectoryPath(depositId);
Path tsmFilePath = depositDirectoryPath.resolve(working.getName());
log.info("Delete [{}]",tsmFilePath);
ProcessHelper.ProcessInfo info = getProcessInfo("tsmDelete",
"dsmc", "delete", "archive", tsmFilePath.toString(), "-noprompt", "-optfile=" + optFilePath);
if (info.wasFailure()) {
String errMessage = String.format("Delete of [%s] failed.", tsmFilePath);
logProcessOutput(info, errMessage);
throw new Exception(errMessage);
} else {
log.info("Delete of [{}] was Successful.", tsmFilePath);
}
log.info("TSM Delete [{}] skipping",tsmFilePath);
//ProcessHelper.ProcessInfo info = getProcessInfo("tsmDelete",
// "dsmc", "delete", "archive", tsmFilePath.toString(), "-noprompt", "-optfile=" + optFilePath);
//if (info.wasFailure()) {
// String errMessage = String.format("Delete of [%s] failed.", tsmFilePath);
// logProcessOutput(info, errMessage);
// throw new Exception(errMessage);
//} else {
// log.info("Delete of [{}] was Successful.", tsmFilePath);
//}
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ void setup() throws IOException {
props.put(PropNames.OPTIONS_DIR, "/tmp/opt");
tsm = Mockito.spy(new TivoliStorageManager("testTSM", props));
}

@Test

// Removed as TSM deletes can never succeed for TSM since the move to write once tapes
// resulted in us not deleting them
/*@Test
void testDeleteSucceeds() throws Exception {
File fileToDelete = Files.createTempFile("test",".txt").toFile();
Expand All @@ -331,9 +333,11 @@ void testDeleteSucceeds() throws Exception {
//Check that the local file has not been deleted. We are trying to delete file on TSM ONLY
assertThat(fileToDelete).exists();
}

@Test
}*/

// Removed as TSM deletes can never fail for TSM since the move to write once tapes
// resulted in us not deleting them
/*@Test
void testDeleteFails() throws Exception {
File fileToDelete = Files.createTempFile("test",".txt").toFile();
Expand Down Expand Up @@ -361,7 +365,7 @@ void testDeleteFails() throws Exception {
//Check that the local file has not been deleted. We are trying to delete file on TSM ONLY
assertThat(fileToDelete).exists();
}
}*/

}

Expand Down

0 comments on commit 592ebad

Please sign in to comment.