sureshanaparti commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r3977452891
##########
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java:
##########
@@ -191,7 +199,134 @@ public void deleteAccessGroup(AccessGroup accessGroup) {
@Override
public AccessGroup updateAccessGroup(AccessGroup accessGroup) {
- return null;
+ if (accessGroup == null) {
+ throw new CloudRuntimeException("Invalid accessGroup object -
accessGroup is null");
+ }
+ // Check if an AccessGroup was constructed without associating it to a
storage pool.
+ if (accessGroup.getStoragePoolId() == null) {
+ throw new CloudRuntimeException("Invalid accessGroup object -
storagePoolId is null");
+ }
+ // At least one host is required regardless of ADD or REMOVE action.
+ // An empty list means there is nothing to add to or remove from the
export policy client list.
+ if (accessGroup.getHostsToConnect() == null ||
accessGroup.getHostsToConnect().isEmpty()) {
+ throw new CloudRuntimeException("Invalid accessGroup object -
hostsToConnect is null or empty");
+ }
+
+ Map<String, String> details =
storagePoolDetailsDao.listDetailsKeyPairs(accessGroup.getStoragePoolId());
+ if (details == null || details.isEmpty()) {
+ throw new CloudRuntimeException("No storage pool details found for
storagePoolId: " + accessGroup.getStoragePoolId());
+ }
+ String exportPolicyId =
details.get(OntapStorageConstants.EXPORT_POLICY_ID);
+ if (exportPolicyId == null || exportPolicyId.isEmpty()) {
Review Comment:
```suggestion
if (StringUtils.isBlank(exportPolicyId)) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]