Skip to content

Commit aa12b63

Browse files
committed
ConfigDrive: use file absolute path instead of canonical path to create ISO
1 parent 38006b2 commit aa12b63

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

engine/storage/configdrive/src/main/java/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ static String getProgramToGenerateIso() throws IOException {
231231
throw new CloudRuntimeException("Cannot create iso for config drive using any know tool. Known paths [/usr/bin/genisoimage, /usr/bin/mkisofs, /usr/local/bin/mkisofs]");
232232
}
233233
if (!isoCreator.canExecute()) {
234-
throw new CloudRuntimeException("Cannot create iso for config drive using: " + isoCreator.getCanonicalPath());
234+
throw new CloudRuntimeException("Cannot create iso for config drive using: " + isoCreator.getAbsolutePath());
235235
}
236-
return isoCreator.getCanonicalPath();
236+
return isoCreator.getAbsolutePath();
237237
}
238238

239239
/**

engine/storage/configdrive/src/test/java/org/apache/cloudstack/storage/configdrive/ConfigDriveBuilderTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public void getProgramToGenerateIsoTestGenIsoExistsAndIsExecutable() throws Exce
435435

436436
Mockito.verify(genIsoFileMock, Mockito.times(2)).exists();
437437
Mockito.verify(genIsoFileMock).canExecute();
438-
Mockito.verify(genIsoFileMock).getCanonicalPath();
438+
Mockito.verify(genIsoFileMock).getAbsolutePath();
439439
}
440440
}
441441

@@ -475,11 +475,11 @@ public void getProgramToGenerateIsoTestNotGenIsoMkIsoInLinux() throws Exception
475475

476476
Mockito.verify(genIsoFileMock, Mockito.times(1)).exists();
477477
Mockito.verify(genIsoFileMock, Mockito.times(0)).canExecute();
478-
Mockito.verify(genIsoFileMock, Mockito.times(0)).getCanonicalPath();
478+
Mockito.verify(genIsoFileMock, Mockito.times(0)).getAbsolutePath();
479479

480480
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(2)).exists();
481481
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(1)).canExecute();
482-
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(1)).getCanonicalPath();
482+
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(1)).getAbsolutePath();
483483
}
484484
}
485485

@@ -509,15 +509,15 @@ public void getProgramToGenerateIsoTestMkIsoMac() throws Exception {
509509

510510
Mockito.verify(genIsoFileMock, Mockito.times(1)).exists();
511511
Mockito.verify(genIsoFileMock, Mockito.times(0)).canExecute();
512-
Mockito.verify(genIsoFileMock, Mockito.times(0)).getCanonicalPath();
512+
Mockito.verify(genIsoFileMock, Mockito.times(0)).getAbsolutePath();
513513

514514
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(1)).exists();
515515
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(0)).canExecute();
516-
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(0)).getCanonicalPath();
516+
Mockito.verify(mkIsoProgramInLinuxFileMock, Mockito.times(0)).getAbsolutePath();
517517

518518
Mockito.verify(mkIsoProgramInMacOsFileMock, Mockito.times(1)).exists();
519519
Mockito.verify(mkIsoProgramInMacOsFileMock, Mockito.times(1)).canExecute();
520-
Mockito.verify(mkIsoProgramInMacOsFileMock, Mockito.times(1)).getCanonicalPath();
520+
Mockito.verify(mkIsoProgramInMacOsFileMock, Mockito.times(1)).getAbsolutePath();
521521
}
522522
}
523523

0 commit comments

Comments
 (0)