diff options
author | xg353y <xg353y@intl.att.com> | 2019-04-26 13:26:25 +0200 |
---|---|---|
committer | xg353y <xg353y@intl.att.com> | 2019-04-30 15:17:51 +0200 |
commit | 39d82def1e54d6584f41ab9f94d30c2057858c32 (patch) | |
tree | bdf6ab8f61b2090a0fc0b05f8116115996175fcd /src/test/resources/http-cache | |
parent | 2d526d7d2113a87ce7b6fbd47bca6f1536822da5 (diff) |
Fix the get loop state logic
Fix the logic to get the loop state and update the CL deploy/undeploy
flow accordingly
Issue-ID: CLAMP-362
Change-Id: I34f83bd241b1029417453908bf932c0b69f9f5b2
Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'src/test/resources/http-cache')
-rwxr-xr-x | src/test/resources/http-cache/third_party_proxy.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py index f19aa0da4..0db977bb4 100755 --- a/src/test/resources/http-cache/third_party_proxy.py +++ b/src/test/resources/http-cache/third_party_proxy.py @@ -199,6 +199,18 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w+') as f: f.write(self.data_string) return True + elif self.path.startswith("/policy/api/v1/policytypes/") and http_type == "GET": + print "self.path start with /policy/api/v1/policytypes/, generating response json..." + jsonGenerated = "{\"policyTypeId\": \"onap.policies.controlloop.operational\",\"policyTypeVersion\": \"1.0.0\",\"policyId\": \"OPERATIONAL_z711F_v1_0_ResourceInstanceName1_tca\"}" + print "jsonGenerated: " + jsonGenerated + if not os.path.exists(cached_file_folder): + os.makedirs(cached_file_folder, 0777) + + with open(cached_file_header, 'w') as f: + f.write("{\"Content-Length\": \"" + str(len(jsonGenerated)) + "\", \"Content-Type\": \"application/json\"}") + with open(cached_file_content, 'w') as f: + f.write(jsonGenerated) + return True else: return False |