aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-04-16 11:06:47 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-16 11:06:47 +0000
commit4f84f4e0c770d7f2b4ab5389925835bd445cdfe1 (patch)
treeed17ac14f4642682f2125285cbd32ca667ba1997
parent271b04557a2408986ab4a4728e609c79fee3da51 (diff)
parent0c47c70a55795801b90f2ee05c267a6996f1ae9d (diff)
Merge "Check for null when building pserver objects from op server obj" into frankfurt
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index c578b29664..adcde92917 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -148,10 +148,16 @@ public class AaiHelper {
public Pserver buildPserver(final Server server) {
Pserver pserver = new Pserver();
pserver.setInMaint(false);
- pserver.setPserverId(server.getId());
pserver.setHostname(server.getHypervisorHostname());
- pserver.setPserverName2(server.getHost());
- pserver.setProvStatus(server.getStatus().value());
+ if (server.getId() != null) {
+ pserver.setPserverId(server.getId());
+ }
+ if (server.getHost() != null) {
+ pserver.setPserverName2(server.getHost());
+ }
+ if (server.getStatus() != null && server.getStatus().value() != null) {
+ pserver.setProvStatus(server.getStatus().value());
+ }
return pserver;
}