summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-iaas-adapter
diff options
context:
space:
mode:
authorPatrick Brady <pb071s@att.com>2017-07-28 11:29:23 -0700
committerPatrick Brady <pb071s@att.com>2017-08-02 15:43:44 +0000
commit38713207b817ed4700f630748c681116338d32f0 (patch)
tree9eb2097cee8d85ac14f17e3a280ae8aefb69d9de /appc-adapters/appc-iaas-adapter
parent771ac55e29d099d8bbf783612de975047d75ab12 (diff)
Merging in bug fixes
Change-Id: I85da90b9ba0d03149f42035a820c76ef0285e413 Signed-off-by: Patrick Brady <pb071s@att.com> Issue: APPC-100
Diffstat (limited to 'appc-adapters/appc-iaas-adapter')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java7
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java32
2 files changed, 28 insertions, 11 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
index de0569d42..1888861c6 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
@@ -52,6 +52,9 @@ import java.util.Properties;
/**
* This class implements the {@link ProviderAdapter} interface. This interface defines the behaviors that our service
* provides.
+ *
+ * @since Aug 12, 2015
+ * @version $Id$
*/
@SuppressWarnings("javadoc")
public class ProviderAdapterImpl implements ProviderAdapter {
@@ -278,8 +281,8 @@ public class ProviderAdapterImpl implements ProviderAdapter {
* provider1.name=ILAB
* provider1.identity=http://provider1:5000/v2.0
* provider1.tenant1.name=CDP-ONAP-APPC
- * provider1.tenant1.userid=cdpdev
- * provider1.tenant1.password=cdpdev@123
+ * provider1.tenant1.userid=testUser
+ * provider1.tenant1.password=testPassword
* provider1.tenant2.name=TEST-TENANT
* provider1.tenant2.userid=testUser
* provider1.tenant2.password=testPassword
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
index f037e58a3..b7ad626ce 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
@@ -535,19 +535,33 @@ public abstract class ProviderServerOperation extends ProviderOperation{
throws ZoneException, RequestFailedException {
logger.info("Performing the Hypervisor status checks..");
- String status = null, state = null, msg = null;
-
- status = server.getHypervisor().getStatus().toString();
- state = server.getHypervisor().getState().toString();
- if (!status.equals(Hypervisor.Status.ENABLED.toString()) || !state.equals(Hypervisor.State.UP.toString())) {
- msg = EELFResourceManager.format(Msg.HYPERVISOR_DOWN_ERROR, server.getHypervisor().getHostName(), server.getName());
- logger.error(msg.toString());
+ String msg = null;
+ if(server.getHypervisor() != null && server.getHypervisor().getStatus() != null && server.getHypervisor().getState() != null)
+ {
+ String status = null, state = null;
+
+ status = server.getHypervisor().getStatus().toString();
+ state = server.getHypervisor().getState().toString();
+
+ if (!status.equals(Hypervisor.Status.ENABLED.toString()) || !state.equals(Hypervisor.State.UP.toString()))
+ {
+ msg = EELFResourceManager.format(Msg.HYPERVISOR_DOWN_ERROR, server.getHypervisor().getHostName(), server.getName());
+ logger.error(msg.toString());
- //doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("Hypervisor status DOWN or NOT ENABLED", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
+ //doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("Hypervisor status DOWN or NOT ENABLED", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
server);
+ }
+ }
+ else
+ {
+ msg = EELFResourceManager.format(Msg.HYPERVISOR_STATUS_UKNOWN, server.getName());
+ logger.error(msg.toString());
+
+ throw new RequestFailedException("Unable to determine Hypervisor status", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
+ server);
}
logger.info("Passed the Hypervisor status checks..");