-
Bug
-
Resolution: Done
-
Medium
-
None
-
El Alto Release, Frankfurt Release
-
None
org.onap.sdnc.config.generator.tool.JSONTool#convertToProperties(java.lang.String, java.util.List<java.lang.String>) escapes forward slashes causing vm-level lcm commands returning 400 response but internally failing with 500 code and actually doing nothing.
Failure:
APPC LCM Stop command execution, payload sent:
{"vm-id":"http://106.120.119.17:8774/v2.1/b1ce7742d956463999923ceaed71786e/servers/13bd6804-444b-4147-83aa-53ae4f32beab","identity-url":"http://106.120.119.17:5000/v3","tenant-id":"b1ce7742d956463999923ceaed71786e"}
How it converted to properties:
Added property: vm-id: http:\/\/106.120.119.17:8774\/v2.1\/b1ce7742d956463999923ceaed71786e\/servers\/13bd6804-444b-4147-83aa-53ae4f32beab Added property: identity-url: http:\/\/106.120.119.17:5000\/v3
and later in the org.onap.appc.adapter.iaas.provider.operation.impl.StopServer#stopServer:
VMURL vm = VMURL.parseURL(vmUrl);
vmUrl has been tried to be splitted with following regex:
"(\\p\{Alnum}+)://([^/:]+)(?::([0-9]+))?(/.*)?/(v[0-9\\.]+)/([^/]+)/servers/([^/]+)"
and failed.
Solution:
Fix org/onap/sdnc/config/generator/tool/JSONTool.java# line 69:
- oString = JSONObject.quote(oString);
+ oString = JSONObject.quote(oString, false);
public static String quote(String string, boolean escapeForwardSlashAlways)
or, alternatively, regexes in the VMURL, IdentityURL need to be fixed accordingly.