Skip to content

Commit a0234e4

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
sync:fix full qualified import
1 parent 11c937d commit a0234e4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package com.cloud.hypervisor.kvm.storage;
1818

1919
import java.io.File;
20+
import java.io.FileWriter;
21+
import java.nio.file.Path;
2022
import java.util.HashMap;
2123
import java.util.List;
2224
import java.util.Map;
@@ -387,20 +389,20 @@ private boolean hasOtherActiveLuns(String host, int port, String iqn, String lun
387389
*/
388390
private void removeStaleScsiDevice(String host, int port, String iqn, String lun) {
389391
String byPath = getByPath(host, port, "/" + iqn + "/" + lun);
390-
java.nio.file.Path byPathLink = java.nio.file.Paths.get(byPath);
391-
if (!java.nio.file.Files.exists(byPathLink)) {
392+
Path byPathLink = Paths.get(byPath);
393+
if (!Files.exists(byPathLink)) {
392394
logger.debug("by-path entry for LUN " + lun + " already gone, nothing to remove");
393395
return;
394396
}
395397
try {
396-
java.nio.file.Path realDevice = byPathLink.toRealPath();
398+
Path realDevice = byPathLink.toRealPath();
397399
String devName = realDevice.getFileName().toString();
398-
java.io.File deleteFile = new java.io.File("/sys/block/" + devName + "/device/delete");
400+
File deleteFile = new File("/sys/block/" + devName + "/device/delete");
399401
if (!deleteFile.exists()) {
400402
logger.warn("sysfs delete entry not found for device " + devName + " — cannot remove stale SCSI device");
401403
return;
402404
}
403-
try (java.io.FileWriter fw = new java.io.FileWriter(deleteFile)) {
405+
try (FileWriter fw = new FileWriter(deleteFile)) {
404406
fw.write("1");
405407
}
406408
logger.info("Removed stale SCSI device " + devName + " for LUN /" + iqn + "/" + lun + " via sysfs");

0 commit comments

Comments
 (0)