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

Commit

Permalink
use flake8 on deployment (#1286)
Browse files Browse the repository at this point in the history
All of the rest of the python codebases within the repo use flake8 as
part of the lint process.  This aligns the deployment code with the
practice.

Co-authored-by: Brian Caswell <bmc@shmoo.com>
  • Loading branch information
bmc-msft and demoray authored Sep 27, 2021
1 parent d3bcbea commit 47bb2ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ jobs:
set -ex
cd src/deployment
python -m pip install --upgrade pip
pip install mypy isort black types-requests
pip install mypy isort black types-requests flake8
mypy .
isort --profile black . --check
black . --check
flake8 *.py
- name: Package Onefuzz
run: |
set -ex
Expand Down
5 changes: 5 additions & 0 deletions src/deployment/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503
max-line-length = 80
max-complexity = 18
select = B,C,E,F,W,T4,B9
16 changes: 9 additions & 7 deletions src/deployment/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ def create_password(self, object_id: UUID) -> Tuple[str, str]:
return add_application_password(object_id, self.get_subscription_id())

def get_instance_url(self) -> str:
## The url to access the instance
## This also represents the legacy identifier_uris of the application registration
# The url to access the instance
# This also represents the legacy identifier_uris of the application
# registration
if self.multi_tenant_domain:
return "https://%s/%s" % (
self.multi_tenant_domain,
Expand All @@ -263,10 +264,11 @@ def get_instance_url(self) -> str:
return "https://%s.azurewebsites.net" % self.application_name

def get_identifier_url(self) -> str:
## The used to identify the application registration via the identifier_uris field
## Depending on the environment this value needs to be from an approved domain
## The format of this value is derived from the default value proposed by azure when creating
## an application registration api://{guid}/...
# This is used to identify the application registration via the
# identifier_uris field. Depending on the environment this value needs
# to be from an approved domain The format of this value is derived
# from the default value proposed by azure when creating an application
# registration api://{guid}/...
if self.multi_tenant_domain:
return "api://%s/%s" % (
self.multi_tenant_domain,
Expand All @@ -275,7 +277,7 @@ def get_identifier_url(self) -> str:
else:
return "api://%s.azurewebsites.net" % self.application_name

def setup_rbac(self) -> None:
def setup_rbac(self) -> None: # noqa: C901
"""
Setup the client application for the OneFuzz instance.
By default, Service Principals do not have access to create
Expand Down

0 comments on commit 47bb2ce

Please sign in to comment.