Skip to content

Commit aaa649f

Browse files
committed
Fix bugs
1 parent 164b5b2 commit aaa649f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/ibmos2spark/osconfig.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,24 +226,29 @@ def __init__(self, sparkcontext, credentials, configuration_name='', cos_type='c
226226
hconf = sparkcontext._jsc.hadoopConfiguration()
227227
hconf.set(prefix + ".endpoint", credentials['endpoint'])
228228

229+
# softlayer cos case
229230
if (cos_type == "classic_cos"):
230231
hconf.set(prefix + ".access.key", credentials['access_key'])
231232
hconf.set(prefix + ".secret.key", credentials['secret_key'])
232233

234+
# bluemix cos case
233235
elif (cos_type == "bluemix_cos"):
234236
hconf.set(prefix + ".iam.service.id", credentials['service_id'])
235237
if (auth_method == "api_key"):
236238
hconf.set(prefix + ".iam.api.key", credentials['api_key'])
237239
elif (auth_method == "iam_token"):
238240
hconf.set(prefix + ".iam.token", credentials['iam_token'])
239241

242+
if (credentials.get('iam_service_endpoint')):
243+
hconf.set(prefix + ".iam.endpoint", credentials['iam_service_endpoint'])
244+
240245
if (credentials.get('v2_signer_type')):
241246
hconf.set(prefix + ".v2.signer.type", credentials['v2_signer_type'])
242247

243248
def _validate_input(self, credentials, cos_type, auth_method):
244249
required_key_classic_cos = ["endpoint", "access_key", "secret_key"]
245250
required_key_list_iam_api_key = ["endpoint", "api_key", "service_id"]
246-
required_key_list_iam_token = ["endpoint", "token", "service_id"]
251+
required_key_list_iam_token = ["endpoint", "iam_token", "service_id"]
247252

248253
def _get_required_keys(cos_type, auth_method):
249254
if (cos_type == "bluemix_cos"):

0 commit comments

Comments
 (0)