diff options
author | 2019-05-25 05:32:49 +0800 | |
---|---|---|
committer | 2019-05-25 05:32:49 +0800 | |
commit | 79f626b0c4419dfcb5b7d1ea0a279a523c6c21bd (patch) | |
tree | d493734e418d8d646df022db36741ac62b304a04 /artifactbroker/plugins/forwarding-plugins | |
parent | 9bd32245361a16cc643219909df35b21949798c3 (diff) |
Fix port mismatch and return value judgement issue
. the port of k8s plugin has changed from 8081 to 9015
. the value from 200 to 300 is acceptable from k8s plugin
Change-Id: I85c61d2275c7913f8c8dbeee0751349552bec29d
Issue-ID: MULTICLOUD-650
Signed-off-by: liboNet <libo.zhu@intel.com>
Diffstat (limited to 'artifactbroker/plugins/forwarding-plugins')
-rw-r--r-- | artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java index d920907..9bfe264 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java +++ b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java @@ -64,7 +64,7 @@ import org.onap.sdc.api.notification.IArtifactInfo; public class K8sArtifactForwarder implements ArtifactForwarder { private static final Logger LOGGER = FlexLogger.getLogger(K8sArtifactForwarder.class); - private static final String BASE_PATH = "http://localhost:8081/v1/rb/definition"; + private static final String BASE_PATH = "http://localhost:9015/v1/rb/definition"; private static final String CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT = "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"; private Map<String, IArtifactInfo> artifactMap; @@ -184,10 +184,12 @@ public class K8sArtifactForwarder implements ArtifactForwarder { String result = EntityUtils.toString(closeableHttpResponse.getEntity()); System.out.println("result = {}" + result); System.out.println("status = {}" + closeableHttpResponse.getStatusLine().getStatusCode()); - if ( closeableHttpResponse.getStatusLine().getStatusCode() != 200 ) { - System.out.println("exception: ret= " + closeableHttpResponse.getStatusLine().getStatusCode()); - } else { + int status = closeableHttpResponse.getStatusLine().getStatusCode(); + // [200, 300] means pass + if ( (status >=200) && (status <= 300) ) { ret = true; + } else { + System.out.println("exception: ret= " + status); } closeableHttpResponse.close(); |