lint: reformat python code with black
This commit is contained in:
parent
331beb01b4
commit
a406a7974b
88 changed files with 2579 additions and 1608 deletions
|
@ -1,8 +1,7 @@
|
|||
from flask import current_app
|
||||
from gitlab import Gitlab
|
||||
|
||||
from app.terraform.block.bridge_reachability import \
|
||||
BlockBridgeReachabilityAutomation
|
||||
from app.terraform.block.bridge_reachability import BlockBridgeReachabilityAutomation
|
||||
|
||||
|
||||
class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation):
|
||||
|
@ -16,15 +15,15 @@ class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation):
|
|||
|
||||
def fetch(self) -> None:
|
||||
self._lines = list()
|
||||
credentials = {"private_token": current_app.config['GITLAB_TOKEN']}
|
||||
credentials = {"private_token": current_app.config["GITLAB_TOKEN"]}
|
||||
if "GITLAB_URL" in current_app.config:
|
||||
credentials['url'] = current_app.config['GITLAB_URL']
|
||||
credentials["url"] = current_app.config["GITLAB_URL"]
|
||||
gitlab = Gitlab(**credentials)
|
||||
project = gitlab.projects.get(current_app.config['GITLAB_BRIDGE_PROJECT'])
|
||||
for vantage_point in current_app.config['GITHUB_BRIDGE_VANTAGE_POINTS']:
|
||||
project = gitlab.projects.get(current_app.config["GITLAB_BRIDGE_PROJECT"])
|
||||
for vantage_point in current_app.config["GITHUB_BRIDGE_VANTAGE_POINTS"]:
|
||||
contents = project.files.get(
|
||||
file_path=f"recentResult_{vantage_point}",
|
||||
ref=current_app.config["GITLAB_BRIDGE_BRANCH"]
|
||||
ref=current_app.config["GITLAB_BRIDGE_BRANCH"],
|
||||
)
|
||||
# Decode the base64 first, then decode the UTF-8 string
|
||||
self._lines.extend(contents.decode().decode('utf-8').splitlines())
|
||||
self._lines.extend(contents.decode().decode("utf-8").splitlines())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue