Skip to content

Commit e1d05b7

Browse files
committed
Add missing superclass call to CloudManager
1 parent 079661e commit e1d05b7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

upcloud_api/cloud_manager/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def request(self, method, endpoint, body=None, params=None, timeout=-1, request_
3030
raise Exception('Invalid/Forbidden HTTP method')
3131

3232
url = 'https://api.upcloud.com/' + self.api_v + endpoint if request_to_api else endpoint
33-
headers = {'Authorization': self.token, 'User-Agent': self._get_user_agent()}
34-
35-
headers['Content-Type'] = (
36-
'application/json' if request_to_api else 'application/octet-stream'
37-
)
33+
headers = {
34+
'Authorization': self.token,
35+
'User-Agent': self._get_user_agent(),
36+
'Content-Type': ('application/json' if request_to_api else 'application/octet-stream'),
37+
}
3838

3939
if body and request_to_api:
4040
data = json.dumps(body)

upcloud_api/cloud_manager/cloud_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def __init__(self, username: str, password: str, timeout: int = 60) -> None:
4343
credentials = f'{username}:{password}'.encode()
4444
encoded_credentials = base64.b64encode(credentials).decode()
4545

46-
self.token = f'Basic {encoded_credentials}'
47-
self.timeout = timeout
46+
super().__init__(
47+
token=f'Basic {encoded_credentials}',
48+
timeout=timeout,
49+
)
4850

4951
def authenticate(self):
5052
"""

0 commit comments

Comments
 (0)