summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle
diff options
context:
space:
mode:
authorburdziak <olaf.burdziakowski@nokia.com>2018-01-24 11:14:22 +0100
committerSkip Wonnell <skip@att.com>2018-01-25 15:31:09 +0000
commit30efe69df55c300d18c79487f14cdd71ec26fada (patch)
tree536b9580828d3543a07abd5de9ba2e358af766c2 /appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle
parent7ad6c46b3fa55967fa58b39622271c867c0ac203 (diff)
Fixes in ServiceCatalogV2
Change-Id: I3b8464818e46dfd204c37bc5421b992ec34ebf2c Issue-ID: APPC-492 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Diffstat (limited to 'appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
index 1e7112cd3..846eca2f5 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
@@ -41,6 +41,9 @@ import com.woorea.openstack.keystone.model.Access.Service.Endpoint;
import com.woorea.openstack.keystone.model.Authentication;
import com.woorea.openstack.keystone.model.Tenant;
import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -81,6 +84,8 @@ import java.util.regex.Pattern;
*/
public class ServiceCatalogV2 extends ServiceCatalog {
+ private final static Logger logger = LoggerFactory.getLogger(ServiceCatalogV2.class);
+
/**
* The Openstack Access object that manages the authenticated token and access control
*/
@@ -121,7 +126,7 @@ public class ServiceCatalogV2 extends ServiceCatalog {
connectorClass = Class.forName(CLIENT_CONNECTOR_CLASS);
connector = (OpenStackClientConnector) connectorClass.newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
- e.printStackTrace();
+ logger.error(e.getMessage());
return;
}
Keystone keystone = new Keystone(identityURL, connector);
@@ -294,23 +299,23 @@ public class ServiceCatalogV2 extends ServiceCatalog {
Lock lock = rwLock.readLock();
lock.lock();
try {
- builder.append(String.format("Service Catalog: tenant %s, id[%s], description[%s]\n", tenant.getName(), //$NON-NLS-1$
+ builder.append(String.format("Service Catalog: tenant %s, id[%s], description[%s]%n", tenant.getName(), //$NON-NLS-1$
tenant.getId(), tenant.getDescription()));
if (regions != null && !regions.isEmpty()) {
- builder.append(String.format("%d regions:\n", regions.size())); //$NON-NLS-1$
+ builder.append(String.format("%d regions:%n", regions.size())); //$NON-NLS-1$
for (String region : regions) {
- builder.append("\t" + region + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ builder.append("\t" + region + "%n"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
- builder.append(String.format("%d services:\n", serviceEndpoints.size())); //$NON-NLS-1$
+ builder.append(String.format("%d services:%n", serviceEndpoints.size())); //$NON-NLS-1$
for (String serviceType : serviceEndpoints.keySet()) {
List<Service.Endpoint> endpoints = serviceEndpoints.get(serviceType);
Service service = serviceTypes.get(serviceType);
- builder.append(String.format("\t%s [%s] - %d endpoints\n", service.getType(), service.getName(), //$NON-NLS-1$
+ builder.append(String.format("\t%s [%s] - %d endpoints%n", service.getType(), service.getName(), //$NON-NLS-1$
endpoints.size()));
for (Service.Endpoint endpoint : endpoints) {
- builder.append(String.format("\t\tRegion [%s], public URL [%s]\n", endpoint.getRegion(), //$NON-NLS-1$
+ builder.append(String.format("\t\tRegion [%s], public URL [%s]%n", endpoint.getRegion(), //$NON-NLS-1$
endpoint.getPublicURL()));
}
}