mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 11:58:09 +00:00
address lint issues (#1117)
This commit is contained in:
@ -24,6 +24,7 @@ from .storage import StorageType, get_primary_account, get_storage_account_name_
|
||||
QueueNameType = Union[str, UUID]
|
||||
|
||||
DEFAULT_TTL = -1
|
||||
DEFAULT_DURATION = datetime.timedelta(days=30)
|
||||
|
||||
|
||||
@cached(ttl=60)
|
||||
@ -48,8 +49,10 @@ def get_queue_sas(
|
||||
add: bool = False,
|
||||
update: bool = False,
|
||||
process: bool = False,
|
||||
duration: datetime.timedelta = datetime.timedelta(days=30),
|
||||
duration: Optional[datetime.timedelta] = None,
|
||||
) -> str:
|
||||
if duration is None:
|
||||
duration = DEFAULT_DURATION
|
||||
account_id = get_primary_account(storage_type)
|
||||
logging.debug("getting queue sas %s (account_id: %s)", queue, account_id)
|
||||
name, key = get_storage_account_name_key(account_id)
|
||||
|
@ -66,6 +66,6 @@ def create_virtual_network(
|
||||
resource_group, name, params
|
||||
)
|
||||
except (CloudError, ResourceNotFoundError) as err:
|
||||
return Error(code=ErrorCode.UNABLE_TO_CREATE_NETWORK, errors=[str(err.message)])
|
||||
return Error(code=ErrorCode.UNABLE_TO_CREATE_NETWORK, errors=[str(err)])
|
||||
|
||||
return None
|
||||
|
@ -17,7 +17,7 @@ from ..tasks.main import Task
|
||||
|
||||
|
||||
def markdown_escape(data: str) -> str:
|
||||
values = "\\*_{}[]()#+-.!"
|
||||
values = r"\\*_{}[]()#+-.!" # noqa: P103
|
||||
for value in values:
|
||||
data = data.replace(value, "\\" + value)
|
||||
data = data.replace("`", "``")
|
||||
|
Reference in New Issue
Block a user