@@ -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_ENABLED + OntapStorageConstants .COMMA + OntapStorageConstants .ISCSI_ENABLED );
112+ OntapStorageConstants .COMMA + OntapStorageConstants .NFS + OntapStorageConstants .COMMA + OntapStorageConstants .ISCSI );
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 {
117- logger .error ("No SVM found on the ONTAP cluster by the name" + svmName );
118- throw new CloudRuntimeException ( "No SVM found on the ONTAP cluster by the name " + svmName ) ;
117+ logger .error ("No SVM found on the ONTAP cluster by the name" + svmName + "." );
118+ return false ;
119119 }
120120
121121 logger .info ("Validating SVM state and protocol settings..." );
122122 if (!Objects .equals (svm .getState (), OntapStorageConstants .RUNNING )) {
123- logger .error ("SVM " + svmName + " is not in running state" );
124- throw new CloudRuntimeException ( "SVM " + svmName + " is not in running state" ) ;
123+ logger .error ("SVM " + svmName + " is not in running state. " );
124+ return false ;
125125 }
126126 if (Objects .equals (storage .getProtocol (), ProtocolType .NFS3 ) && !svm .getNfsEnabled ()) {
127127 logger .error ("NFS protocol is not enabled on SVM " + svmName );
128- throw new CloudRuntimeException ( "NFS protocol is not enabled on SVM " + svmName ) ;
128+ return false ;
129129 } else if (Objects .equals (storage .getProtocol (), ProtocolType .ISCSI ) && !svm .getIscsiEnabled ()) {
130130 logger .error ("iSCSI protocol is not enabled on SVM " + svmName );
131- throw new CloudRuntimeException ( "iSCSI protocol is not enabled on SVM " + svmName ) ;
131+ return false ;
132132 }
133133 List <Aggregate > aggrs = svm .getAggregates ();
134134 if (aggrs == null || aggrs .isEmpty ()) {
135135 logger .error ("No aggregates are assigned to SVM " + svmName );
136- throw new CloudRuntimeException ( "No aggregates are assigned to SVM " + svmName ) ;
136+ return false ;
137137 }
138138 for (Aggregate aggr : aggrs ) {
139139 logger .debug ("Found aggregate: " + aggr .getName () + " with UUID: " + aggr .getUuid ());
@@ -156,13 +156,13 @@ public boolean connect() {
156156 }
157157 if (this .aggregates == null || this .aggregates .isEmpty ()) {
158158 logger .error ("No suitable aggregates found on SVM " + svmName + " for volume creation." );
159- return false ;
159+ throw new CloudRuntimeException ( "No suitable aggregates found on SVM " + svmName + " for volume creation." ) ;
160160 }
161161
162162 logger .info ("Successfully connected to ONTAP cluster and validated ONTAP details provided" );
163163 } catch (Exception e ) {
164164 logger .error ("Failed to connect to ONTAP cluster: " + e .getMessage (), e );
165- return false ;
165+ throw new CloudRuntimeException ( "Failed to connect to ONTAP cluster: " + e . getMessage (), e ) ;
166166 }
167167 return true ;
168168 }
0 commit comments