From 07a1b496b61c0515b6aa2f6235496e60191991ec Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Thu, 30 Apr 2020 09:58:21 -0400 Subject: Fight against the encoding in openstack Fight against the encoding in openstack Fight against the encoding in openstack Issue-ID: SO-2854 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I239093e28f835a5de480f07b480c5ec3931ccc83 --- .../main/java/org/onap/so/openstack/utils/GlanceClientImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java index 740eb778b0..687afeda40 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java @@ -74,10 +74,13 @@ public class GlanceClientImpl extends MsoCommonUtils { String encodedName = null; if (name != null) { try { - encodedName = URLEncoder.encode(name, "UTF-8"); + encodedName = + "in:\"" + URLEncoder.encode(name, "UTF-8").replace("+", "%20").replace("%3A", ":") + "\""; } catch (UnsupportedEncodingException e) { - logger.error("error encoding query parameter: {}", encodedName); + logger.error("Error Encoding Image Name", e); + throw new GlanceClientException("Error Endcoding Name", e); } + } Glance glanceClient = getGlanceClient(cloudSiteId, tenantId); // list is set to false, otherwise an invalid URL is appended -- cgit 1.2.3-korg