diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2020-04-30 10:53:23 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-05-04 11:00:46 +0000 |
commit | 048bd5e527128ab84a2725cd39761648b8ec9c62 (patch) | |
tree | e89edffa6c9523726712cb77f85267c05568508b /vid-app-common/src/main/java/org/onap/vid/job/command | |
parent | 80bc6dd4678e2c4057d494ba29c8dd9b0c999abc (diff) |
When cloud region is missing then omit the cloudConfiguration object
Issue-ID: VID-820
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Change-Id: I0780649982c0a1ae0a5bc56da438d422a710e4bf
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt index c3fdcdaeb..c31e69300 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt @@ -341,11 +341,13 @@ class MsoRequestBuilder return subscriberInfo } - private fun generateCloudConfiguration(lcpCloudRegionId: String?, tenantId: String?): CloudConfiguration { + private fun generateCloudConfiguration(lcpCloudRegionId: String?, tenantId: String?): CloudConfiguration? { + + if (lcpCloudRegionId.isNullOrEmpty()) return null + val cloudConfiguration = CloudConfiguration(lcpCloudRegionId, tenantId) - if (lcpCloudRegionId != null) { - cloudOwnerService.enrichCloudConfigurationWithCloudOwner(cloudConfiguration, lcpCloudRegionId) - } + cloudOwnerService.enrichCloudConfigurationWithCloudOwner(cloudConfiguration, lcpCloudRegionId) + return cloudConfiguration } |