diff options
author | Steve Smokowski <ss835w@att.com> | 2020-04-16 11:06:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-16 11:06:47 +0000 |
commit | 4f84f4e0c770d7f2b4ab5389925835bd445cdfe1 (patch) | |
tree | ed17ac14f4642682f2125285cbd32ca667ba1997 /adapters | |
parent | 271b04557a2408986ab4a4728e609c79fee3da51 (diff) | |
parent | 0c47c70a55795801b90f2ee05c267a6996f1ae9d (diff) |
Merge "Check for null when building pserver objects from op server obj" into frankfurt
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java | 12 |
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; } |