catching URL malformed in case of non openstack vims
package org.openbaton.nfvo.core.api;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import org.openbaton.catalogue.mano.common.DeploymentFlavour;
import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit;
import org.openbaton.catalogue.mano.descriptor.VirtualNetworkFunctionDescriptor;
@@ -61,6 +49,20 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
/** Created by lto on 13/05/15. */
@Service
@Scope
@@ -343,8 +345,12 @@ public class VimManagement implements org.openbaton.nfvo.core.interfaces.VimMana
if (vimInstance.getType().equals("test")) {
continue;
}
-
- URL authUrl = new URL(vimInstance.getAuthUrl());
+ URL authUrl;
+ try {
+ authUrl = new URL(vimInstance.getAuthUrl());
+ } catch (MalformedURLException ignored){
+ return;
+ }
log.trace(
"Checking host: " + authUrl.getHost() + " of VimInstance " + vimInstance.getName());
byte[] bytes = authUrl.getHost().getBytes();
