Skip to content

Commit fb08160

Browse files
committed
API: Adds deprecation warning to set_authentication()
1 parent 7012a9a commit fb08160

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

SoftLayer/deprecated.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def __init__(self, id=None, username=None, api_key=None, **kwargs):
2222
self.set_init_parameter(int(id))
2323

2424
if username and api_key:
25-
self.set_authentication(username, api_key)
25+
self._headers['authenticate'] = {
26+
'username': username.strip(),
27+
'apiKey': api_key.strip(),
28+
}
2629

2730
def __getattr__(self, name):
2831
""" Attempt a SoftLayer API call.
@@ -105,6 +108,7 @@ def set_authentication(self, username, api_key):
105108
.. deprecated:: 2.0.0
106109
107110
"""
111+
warn("deprecated", DeprecationWarning)
108112
self.add_header('authenticate', {
109113
'username': username.strip(),
110114
'apiKey': api_key.strip(),

0 commit comments

Comments
 (0)