diff options
Diffstat (limited to 'adapters/mso-openstack-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; } |