Skip to content

Commit c4ba31d

Browse files
committed
chore(key): can't replace key but only convert to lower
1 parent b7b3723 commit c4ba31d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ibm_cloud_sdk_core/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def read_from_credential_file(service_name, separator='='):
135135

136136
def _parse_key_and_update_config(config, service_name, key, value):
137137
service_name = service_name.replace(' ', '_').replace('-', '_').lower()
138-
key = key.replace(' ', '_').replace('-', '_').lower()
138+
key = key.lower()
139139
if key.startswith(service_name):
140140
config[key[len(service_name) + 1:]] = value
141141

resources/ibm-credentials-iam.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IBM-WATSON_APIKEY=5678efgh
2-
IBM-WATSON_AUTH_TYPE=iam
3-
IBM-WATSON_URL=https://gateway-s.watsonplatform.net/watson/api
4-
IBM-WATSON_DISABLE_SSL=False
1+
IBM_WATSON_APIKEY=5678efgh
2+
IBM_WATSON_AUTH_TYPE=iam
3+
IBM_WATSON_URL=https://gateway-s.watsonplatform.net/watson/api
4+
IBM_WATSON_DISABLE_SSL=False

test/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def test_vcap_credentials():
8888
del os.environ['VCAP_SERVICES']
8989

9090
def test_multi_word_service_name():
91-
os.environ['PERSONALITY-INSIGHTS_APIKEY'] = '5678efgh'
91+
os.environ['PERSONALITY_INSIGHTS_APIKEY'] = '5678efgh'
9292
authenticator = get_authenticator_from_environment('personality-insights')
9393
assert authenticator is not None
9494
assert authenticator.token_manager.apikey == '5678efgh'
95-
del os.environ['PERSONALITY-INSIGHTS_APIKEY']
95+
del os.environ['PERSONALITY_INSIGHTS_APIKEY']

0 commit comments

Comments
 (0)