|
11 | 11 |
|
12 | 12 |
|
13 | 13 | class Manager(BaseAPI): |
| 14 | + |
14 | 15 | def __init__(self, auth_token, consumer_token=None): |
15 | 16 | super(Manager, self).__init__(auth_token, consumer_token) |
16 | 17 |
|
17 | 18 | def call_api(self, method, type='GET', params=None): |
18 | | - return super(Manager, self).call_api(method, type, params) # pragma: no cover |
| 19 | + return super(Manager, self).call_api(method, type, params) |
19 | 20 |
|
20 | 21 | def get_user(self): |
21 | 22 | return self.call_api("user") |
@@ -70,10 +71,20 @@ def list_devices(self, project_id, params={}): |
70 | 71 | devices.append(device) |
71 | 72 | return devices |
72 | 73 |
|
73 | | - def create_device(self, project_id, hostname, plan, facility, |
74 | | - operating_system, billing_cycle='hourly', userdata='', |
75 | | - locked=False, tags={}, features={}, ipxe_script_url='', |
76 | | - always_pxe=False, public_ipv4_subnet_size=31): |
| 74 | + def create_device(self, |
| 75 | + project_id, |
| 76 | + hostname, |
| 77 | + plan, |
| 78 | + facility, |
| 79 | + operating_system, |
| 80 | + billing_cycle='hourly', |
| 81 | + userdata='', |
| 82 | + locked=False, |
| 83 | + tags={}, |
| 84 | + features={}, |
| 85 | + ipxe_script_url='', |
| 86 | + always_pxe=False, |
| 87 | + public_ipv4_subnet_size=31): |
77 | 88 |
|
78 | 89 | params = { |
79 | 90 | 'hostname': hostname, |
@@ -152,13 +163,7 @@ def get_capacity(self): |
152 | 163 | def validate_capacity(self, servers): |
153 | 164 | params = {'servers': []} |
154 | 165 | for server in servers: |
155 | | - params['servers'].append( |
156 | | - { |
157 | | - 'facility': server[0], |
158 | | - 'plan': server[1], |
159 | | - 'quantity': server[2] |
160 | | - } |
161 | | - ) |
| 166 | + params['servers'].append({'facility': server[0], 'plan': server[1], 'quantity': server[2]}) |
162 | 167 |
|
163 | 168 | try: |
164 | 169 | self.call_api('/capacity', 'POST', params) |
|
0 commit comments