Skip to content

Commit eedcb4a

Browse files
committed
Add a handful of TODO notes
1 parent e1d05b7 commit eedcb4a

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

upcloud_api/cloud_manager/base.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ def request(self, method, endpoint, body=None, params=None, timeout=-1, request_
2929
if method not in {'GET', 'POST', 'PUT', 'PATCH', 'DELETE'}:
3030
raise Exception('Invalid/Forbidden HTTP method')
3131

32+
# TODO: revise the semantics of `request_to_api` and where it is set to False
3233
url = 'https://api.upcloud.com/' + self.api_v + endpoint if request_to_api else endpoint
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-
}
34+
headers = {'Authorization': self.token, 'User-Agent': self._get_user_agent()}
35+
36+
headers['Content-Type'] = (
37+
'application/json' if request_to_api else 'application/octet-stream'
38+
)
3839

3940
if body and request_to_api:
4041
data = json.dumps(body)

upcloud_api/cloud_manager/firewall_mixin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class FirewallManager:
1717
directly.
1818
"""
1919

20+
# TODO: server_instance is unused?
2021
def get_firewall_rule(self, server_uuid, firewall_rule_position, server_instance=None):
2122
"""
2223
Return a FirewallRule object based on server uuid and rule position.

upcloud_api/cloud_manager/network_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create_network(
5757
},
5858
}
5959
}
60-
60+
# TODO: fix duplication c.f. modify_network
6161
if router:
6262
body['network']['router'] = router
6363
if dhcp_default_route:

upcloud_api/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def to_dict(self):
410410
del fields['cloud_manager']
411411
return fields
412412

413+
# TODO: strict is unused?
413414
def get_ip(self, access='public', addr_family=None, strict=None):
414415
"""
415416
Return the server's IP address.

0 commit comments

Comments
 (0)