1313
1414
1515class VmClient :
16- def __init__ (
17- self , account : Account , domain : str = ""
18- ):
16+ def __init__ (self , account : Account , domain : str = "" ):
1917 self .account : Account = account
2018 self .ephemeral_key = jwk .JWK .generate (kty = "EC" , crv = "P-256" )
2119 self .expected_domain = domain
@@ -30,9 +28,9 @@ def _generate_pubkey_payload(self):
3028 "domain" : self .expected_domain ,
3129 "address" : self .account .address ,
3230 "expires" : (
33- datetime .datetime .utcnow () + datetime .timedelta (days = 1 )
34- ).isoformat ()
35- + "Z" ,
31+ datetime .datetime .utcnow () + datetime .timedelta (days = 1 )
32+ ).isoformat ()
33+ + "Z" ,
3634 }
3735
3836 def _generate_pubkey_signature_header (self ):
@@ -174,7 +172,7 @@ async def expire_instance(self, vm_id):
174172 async def notify_allocation (self , vm_id ) -> Tuple [Any , str ]:
175173 json_data = {"instance" : vm_id }
176174 async with self .session .post (
177- f"https://{ self .expected_domain } /control/allocation/notify" , json = json_data
175+ f"https://{ self .expected_domain } /control/allocation/notify" , json = json_data
178176 ) as s :
179177 form_response_text = await s .text ()
180178 return s .status , form_response_text
0 commit comments