mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
cleanup logging in multiple functions (#73)
This commit is contained in:
@ -58,7 +58,7 @@ def get_storage_account_name_key(account_id: Optional[str] = None) -> Tuple[str,
|
||||
|
||||
@cached(ttl=60)
|
||||
def get_blob_service(account_id: Optional[str] = None) -> BlockBlobService:
|
||||
logging.info("getting blob container (account_id: %s)", account_id)
|
||||
logging.debug("getting blob container (account_id: %s)", account_id)
|
||||
name, key = get_storage_account_name_key(account_id)
|
||||
service = BlockBlobService(account_name=name, account_key=key)
|
||||
return service
|
||||
|
@ -26,7 +26,7 @@ QueueNameType = Union[str, UUID]
|
||||
|
||||
@cached(ttl=60)
|
||||
def get_queue_client(account_id: str) -> QueueServiceClient:
|
||||
logging.info("getting blob container (account_id: %s)", account_id)
|
||||
logging.debug("getting blob container (account_id: %s)", account_id)
|
||||
name, key = get_storage_account_name_key(account_id)
|
||||
account_url = "https://%s.queue.core.windows.net" % name
|
||||
client = QueueServiceClient(
|
||||
@ -36,6 +36,7 @@ def get_queue_client(account_id: str) -> QueueServiceClient:
|
||||
return client
|
||||
|
||||
|
||||
@cached(ttl=60)
|
||||
def get_queue_sas(
|
||||
queue: QueueNameType,
|
||||
*,
|
||||
@ -45,7 +46,7 @@ def get_queue_sas(
|
||||
update: bool = False,
|
||||
process: bool = False,
|
||||
) -> str:
|
||||
logging.info("getting queue sas %s (account_id: %s)", queue, account_id)
|
||||
logging.debug("getting queue sas %s (account_id: %s)", queue, account_id)
|
||||
name, key = get_storage_account_name_key(account_id)
|
||||
expiry = datetime.datetime.utcnow() + datetime.timedelta(days=30)
|
||||
|
||||
|
@ -20,7 +20,7 @@ def get_client(
|
||||
if account_id is None:
|
||||
account_id = os.environ["ONEFUZZ_FUNC_STORAGE"]
|
||||
|
||||
logging.info("getting table account: (account_id: %s)", account_id)
|
||||
logging.debug("getting table account: (account_id: %s)", account_id)
|
||||
name, key = get_storage_account_name_key(account_id)
|
||||
client = TableService(account_name=name, account_key=key)
|
||||
|
||||
|
Reference in New Issue
Block a user