Repository: stratos Updated Branches: refs/heads/master 9a4cb2af4 -> a2b12f6ef
Fixed get method in meta data api Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/11826a0a Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/11826a0a Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/11826a0a Branch: refs/heads/master Commit: 11826a0adaa3fcf124d0831bc0bbf8625ed5a1f1 Parents: 9a4cb2a Author: Pubudu Gunatilaka <[email protected]> Authored: Fri Jul 10 15:35:56 2015 +0530 Committer: Pubudu Gunatilaka <[email protected]> Committed: Fri Jul 10 15:35:56 2015 +0530 ---------------------------------------------------------------------- .../cartridge.agent/cartridge.agent/mdsclient.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/11826a0a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/mdsclient.py ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/mdsclient.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/mdsclient.py index b818deb..c5759d7 100644 --- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/mdsclient.py +++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/mdsclient.py @@ -51,7 +51,8 @@ def put(put_req, app=False): put_request.add_header('Content-Type', 'application/json') try: - log.debug("Publishing metadata to Metadata service. [URL] %s, [DATA] %s" % (put_request.get_full_url(), request_data)) + log.debug( + "Publishing metadata to Metadata service. [URL] %s, [DATA] %s" % (put_request.get_full_url(), request_data)) handler = urllib2.urlopen(put_request, request_data) log.debug("Metadata service response: %s" % handler.getcode()) @@ -73,17 +74,17 @@ def get(app=False): try: if app: log.debug("Retrieving metadata from the Metadata service. [URL] %s" % app_resource_url) - request = urllib2.Request(app_resource_url) + request = urllib2.Request(app_resource_url) else: log.debug("Retrieving metadata from the Metadata service. [URL] %s" % alias_resource_url) - request = urllib2.Request(alias_resource_url) + request = urllib2.Request(alias_resource_url) - request.add_header("Authorization", "Bearer %s" % token) - request.add_header('Content-Type', 'application/json') + request.add_header("Authorization", "Bearer %s" % token) + request.add_header('Content-Type', 'application/json') - response = urllib2.urlopen(request).read() - get_response = json.loads(response) - properties = get_response["properties"] + response = urllib2.urlopen(request).read() + get_response = json.loads(response) + properties = get_response["properties"] log.debug("Retrieved values from Metadata service: %s" % properties) response_obj = MDSResponse()
