snowch / ibm-analytics-engine-python

Python library for IBM Analytics Engine - https://console.bluemix.net/docs/services/AnalyticsEngine/index.html
Apache License 2.0
11 stars 2 forks source link

Code Improvements #2

Open snowch opened 7 years ago

snowch commented 7 years ago
    self.info = self._get_info()
    ...
    def _get_info(self):
        url = '{}/v2/info'.format(self.api_endpoint)
        response = self._request(url=url, http_method='get', description='_get_info', create_auth_headers=False)
        return response.json()

to

    def _get_info(self):
        url = '{}/v2/info'.format(self.api_endpoint)
        response = self._request(url=url, http_method='get', description='_get_info', create_auth_headers=False)
        return response.json()['authorization_endpoint'] + '/oauth/token'
if status == 'succeeded':
   credentials_json = iae.create_credentials(cluster_instance_id)
   vcap_json = credentials_json['entity']['credentials']
   print('>> VCAP:\n' + json.dumps(vcap_json, indent=4, separators=(',', ': ')))

Should be:

if status == 'succeeded':
   vcap_json = iae.create_credentials(cluster_instance_id)
   print('>> VCAP:\n' + json.dumps(vcap_json, indent=4, separators=(',', ': ')))