diff options
2 files changed, 9 insertions, 3 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index 0512912b9f..04c6ea4ff7 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -488,7 +488,13 @@ public class HeatBridgeImpl implements HeatBridgeApi { for (Pserver pserver : serverHostnames.values()) { AAIResourceUri uri = AAIUriFactory .createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().pserver(pserver.getHostname())); - resourcesClient.createIfNotExists(uri, Optional.of(pserver)); + if (resourcesClient.exists(uri)) { + Pserver updatePserver = new Pserver(); + updatePserver.setPserverId(pserver.getPserverId()); + resourcesClient.update(uri, updatePserver); + } else { + resourcesClient.create(uri, pserver); + } } } 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 1f6c0df90f..bbdd05bddc 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 @@ -247,8 +247,8 @@ public class AaiHelper { Pserver pserver = new Pserver(); pserver.setInMaint(false); pserver.setHostname(server.getHypervisorHostname()); - if (server.getId() != null) { - pserver.setPserverId(server.getId()); + if (server.getHostId() != null) { + pserver.setPserverId(server.getHostId()); } if (server.getHost() != null) { pserver.setPserverName2(server.getHost()); |