mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-13 10:38:08 +00:00
Use Storage Account types, rather than account_id (#320)
We need to move to supporting data sharding. One of the steps towards that is stop passing around `account_id`, rather we need to specify the type of storage we need.
This commit is contained in:
@ -18,7 +18,7 @@ from onefuzztypes.webhooks import (
|
||||
WebhookEventTaskStopped,
|
||||
)
|
||||
|
||||
from ..azure.creds import get_fuzz_storage
|
||||
from ..azure.containers import StorageType
|
||||
from ..azure.image import get_os
|
||||
from ..azure.queue import create_queue, delete_queue
|
||||
from ..orm import MappingIntStrAny, ORMMixin, QueryFilter
|
||||
@ -123,7 +123,7 @@ class Task(BASE_TASK, ORMMixin):
|
||||
}
|
||||
|
||||
def init(self) -> None:
|
||||
create_queue(self.task_id, account_id=get_fuzz_storage())
|
||||
create_queue(self.task_id, StorageType.corpus)
|
||||
self.state = TaskState.waiting
|
||||
self.save()
|
||||
|
||||
@ -132,7 +132,7 @@ class Task(BASE_TASK, ORMMixin):
|
||||
|
||||
logging.info("stopping task: %s:%s", self.job_id, self.task_id)
|
||||
ProxyForward.remove_forward(self.task_id)
|
||||
delete_queue(str(self.task_id), account_id=get_fuzz_storage())
|
||||
delete_queue(str(self.task_id), StorageType.corpus)
|
||||
Node.stop_task(self.task_id)
|
||||
self.state = TaskState.stopped
|
||||
self.save()
|
||||
|
Reference in New Issue
Block a user