@@ -109,33 +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 {
117- logger .error ("No SVM found on the ONTAP cluster by the name" + svmName + "." );
118- return false ;
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 ) ;
119119 }
120120
121121 logger .info ("Validating SVM state and protocol settings..." );
122- logger .info ("Protocol storage.getProtocol() = " + storage .getProtocol () + " Objects.equals(storage.getProtocol(), ProtocolType.ISCSI) " + Objects .equals (storage .getProtocol (), ProtocolType .ISCSI ));
123- logger .info ("svm.getIscsiEnabled() : " + svm .getIscsiEnabled () + "svm.getNfsEnabled() : " + svm .getNfsEnabled ());
124122 if (!Objects .equals (svm .getState (), OntapStorageConstants .RUNNING )) {
125- logger .error ("SVM " + svmName + " is not in running state. " );
126- return false ;
123+ logger .error ("SVM " + svmName + " is not in running state" );
124+ throw new CloudRuntimeException ( "SVM " + svmName + " is not in running state" ) ;
127125 }
128126 if (Objects .equals (storage .getProtocol (), ProtocolType .NFS3 ) && !svm .getNfsEnabled ()) {
129127 logger .error ("NFS protocol is not enabled on SVM " + svmName );
130- return false ;
128+ throw new CloudRuntimeException ( "NFS protocol is not enabled on SVM " + svmName ) ;
131129 } else if (Objects .equals (storage .getProtocol (), ProtocolType .ISCSI ) && !svm .getIscsiEnabled ()) {
132130 logger .error ("iSCSI protocol is not enabled on SVM " + svmName );
133- return false ;
131+ throw new CloudRuntimeException ( "iSCSI protocol is not enabled on SVM " + svmName ) ;
134132 }
135133 List <Aggregate > aggrs = svm .getAggregates ();
136134 if (aggrs == null || aggrs .isEmpty ()) {
137135 logger .error ("No aggregates are assigned to SVM " + svmName );
138- return false ;
136+ throw new CloudRuntimeException ( "No aggregates are assigned to SVM " + svmName ) ;
139137 }
140138 for (Aggregate aggr : aggrs ) {
141139 logger .debug ("Found aggregate: " + aggr .getName () + " with UUID: " + aggr .getUuid ());
0 commit comments