@@ -109,31 +109,31 @@ public boolean connect() {
109109 logger .info ("Fetching the SVM details..." );
110110 Map <String , Object > queryParams = Map .of (OntapStorageConstants .NAME , svmName , OntapStorageConstants .FIELDS , OntapStorageConstants .AGGREGATES +
111111 OntapStorageConstants .COMMA + OntapStorageConstants .STATE +
112- OntapStorageConstants .COMMA + OntapStorageConstants .NFS + OntapStorageConstants .COMMA + OntapStorageConstants .ISCSI );
112+ OntapStorageConstants .COMMA + OntapStorageConstants .NFS_ENABLED + OntapStorageConstants .COMMA + OntapStorageConstants .ISCSI_ENABLED );
113113 OntapResponse <Svm > svms = svmFeignClient .getSvmResponse (queryParams , authHeader );
114114 if (svms != null && svms .getRecords () != null && !svms .getRecords ().isEmpty ()) {
115115 svm = svms .getRecords ().get (0 );
116116 } else {
117117 logger .error ("No SVM found on the ONTAP cluster by the name" + svmName + "." );
118- return false ;
118+ throw new CloudRuntimeException ( "No SVM found on the ONTAP cluster by the name" + svmName + "." ) ;
119119 }
120120
121121 logger .info ("Validating SVM state and protocol settings..." );
122122 if (!Objects .equals (svm .getState (), OntapStorageConstants .RUNNING )) {
123123 logger .error ("SVM " + svmName + " is not in running state." );
124- return false ;
124+ throw new CloudRuntimeException ( "SVM " + svmName + " is not in running state." ) ;
125125 }
126126 if (Objects .equals (storage .getProtocol (), ProtocolType .NFS3 ) && !svm .getNfsEnabled ()) {
127127 logger .error ("NFS protocol is not enabled on SVM " + svmName );
128- return false ;
128+ throw new CloudRuntimeException ( "NFS protocol is not enabled on SVM " + svmName ) ;
129129 } else if (Objects .equals (storage .getProtocol (), ProtocolType .ISCSI ) && !svm .getIscsiEnabled ()) {
130130 logger .error ("iSCSI protocol is not enabled on SVM " + svmName );
131- return false ;
131+ throw new CloudRuntimeException ( "iSCSI protocol is not enabled on SVM " + svmName ) ;
132132 }
133133 List <Aggregate > aggrs = svm .getAggregates ();
134134 if (aggrs == null || aggrs .isEmpty ()) {
135135 logger .error ("No aggregates are assigned to SVM " + svmName );
136- return false ;
136+ throw new CloudRuntimeException ( "No aggregates are assigned to SVM " + svmName ) ;
137137 }
138138 for (Aggregate aggr : aggrs ) {
139139 logger .debug ("Found aggregate: " + aggr .getName () + " with UUID: " + aggr .getUuid ());
0 commit comments