Skip to content

Commit d1a795b

Browse files
CSTACKEX-191: addressing copilot comments
1 parent db8f1af commit d1a795b

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ private void grantAccessIscsi(Host host, VolumeVO volumeVO, Map<String, String>
433433
}else{
434434
logger.info("grantAccess: Igroup {} already exist for the host {}: ", accessGroup.getIgroup().getName() , host.getName());
435435
/* TODO Below cases will be covered later, for now they will be a pre-requisite on customer side
436-
1. Igroup exist with the same name but host initiator has been rempved
436+
1. Igroup exist with the same name but host initiator has been removed
437437
2. Igroup exist with the same name but host initiator has been changed may be due to new NIC or new adapter
438438
In both cases we need to verify current host initiator is registered in the igroup before allowing access
439439
Incase it is not , add it and proceed for lun-mapping

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ public abstract JobResponse revertSnapshotForCloudStackVolume(String snapshotNam
593593
* //TODO for NFS 3.0 and NFS 4.1 protocols (e.g., export rule management)
594594
* //TODO for Nvme/TCP and Nvme/FC protocols
595595
* @param values map including SVM name, LUN name, and igroup name (for SAN) or equivalent for NAS
596-
* @return map containing logical unit number for the new/existing mapping (SAN) or relevant info for NAS
596+
* @return String containing logical unit number for the new/existing mapping (SAN) or relevant info for NAS
597597
*/
598598
abstract public String enableLogicalAccess(Map<String,String> values);
599599

@@ -608,7 +608,7 @@ public abstract JobResponse revertSnapshotForCloudStackVolume(String snapshotNam
608608
* Method encapsulates the behavior based on the opted protocol in subclasses
609609
* lunMap lookup for iSCSI/FC protocols (GET-only, no side-effects)
610610
* @param values map with SVM name, LUN name, and igroup name (for SAN) or equivalent for NAS
611-
* @return map containing logical unit number if mapping exists; otherwise null
611+
* @return String containing logical unit number if mapping exists; otherwise null
612612
*/
613613
abstract public String getLogicalAccess(Map<String, String> values);
614614

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedSANStrategy.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ public AccessGroup getAccessGroup(Map<String, String> values) {
377377
}
378378
}
379379

380+
@Override
380381
public String enableLogicalAccess(Map<String, String> values) {
381382
logger.trace("enableLogicalAccess : Creating LunMap with values {} ", values);
382383
String lunNumber = null;
@@ -478,6 +479,7 @@ public void disableLogicalAccess(Map<String, String> values) {
478479
}
479480

480481
// GET-only helper: fetch LUN-map and return logical unit number if it exists; otherwise return null
482+
@Override
481483
public String getLogicalAccess(Map<String, String> values) {
482484
String lunNumber = null;
483485
logger.trace("getLogicalAccess : Fetching LunMap with values {} ", values);

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/UnifiedSANStrategyTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void testEnableLogicalAccess_Success() {
520520

521521
// Verify
522522
assertNotNull(result);
523-
523+
assertEquals("0", result);
524524
verify(sanFeignClient).createLunMap(eq(authHeader), eq(true), any(LunMap.class));
525525
}
526526
}
@@ -552,6 +552,7 @@ void testEnableLogicalAccess_AlreadyMapped_ReturnsLunNumber() {
552552

553553
// Verify
554554
assertNotNull(result);
555+
assertEquals("5", result);
555556
}
556557
}
557558

0 commit comments

Comments
 (0)