fix crash on refresh: change ids are strings in the snapd api
for https://bugs.launchpad.net/subiquity/+bug/1913417
This commit is contained in:
parent
e813726aaa
commit
6fa1d9bbd0
|
@ -84,11 +84,11 @@ class API:
|
|||
|
||||
If wait is true, block until the status is known."""
|
||||
|
||||
def POST() -> int:
|
||||
def POST() -> str:
|
||||
"""Start the update and return the change id."""
|
||||
|
||||
class progress:
|
||||
def GET(change_id: int) -> dict: ...
|
||||
def GET(change_id: str) -> dict: ...
|
||||
|
||||
class zdev:
|
||||
def GET() -> List[ZdevInfo]: ...
|
||||
|
|
|
@ -212,8 +212,8 @@ class RefreshController(SubiquityController):
|
|||
await self.check_task.wait()
|
||||
return self.status
|
||||
|
||||
async def POST(self, context) -> int:
|
||||
async def POST(self, context) -> str:
|
||||
return await self.start_update(context=context)
|
||||
|
||||
async def progress_GET(self, change_id: int) -> dict:
|
||||
async def progress_GET(self, change_id: str) -> dict:
|
||||
return await self.get_progress(change_id)
|
||||
|
|
|
@ -132,14 +132,14 @@ class FakeSnapdConnection:
|
|||
if path == "v2/snaps/subiquity" and body['action'] == 'refresh':
|
||||
return _FakeMemoryResponse({
|
||||
"type": "async",
|
||||
"change": 7,
|
||||
"change": "7",
|
||||
"status-code": 200,
|
||||
"status": "OK",
|
||||
})
|
||||
if path == "v2/snaps/subiquity" and body['action'] == 'switch':
|
||||
return _FakeMemoryResponse({
|
||||
"type": "async",
|
||||
"change": 8,
|
||||
"change": "8",
|
||||
"status-code": 200,
|
||||
"status": "Accepted",
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue