Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

address lint issues in api-service #1117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/api-service/__app__/onefuzzlib/azure/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
QueueNameType = Union[str, UUID]

DEFAULT_TTL = -1
DEFAULT_DURATION = datetime.timedelta(days=30)


@cached(ttl=60)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/api-service/__app__/onefuzzlib/azure/subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/api-service/__app__/onefuzzlib/notifications/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def markdown_escape(data: str) -> str:
values = "\\*_{}[]()#+-.!"
values = r"\\*_{}[]()#+-.!" # noqa: P103
for value in values:
data = data.replace(value, "\\" + value)
data = data.replace("`", "``")
Expand Down