From 7964814e3a593046f5bf07581c9c40ab2a9f0b17 Mon Sep 17 00:00:00 2001 From: Yury Hrytsuk <50014626+YuryHrytsuk@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:47:32 +0100 Subject: [PATCH] Run pre commit hooks (#432) * Return removed staging CA for letsenrypt * Fix missing $ * Remove PAYMENTS_AUTORECHARGE_DEFAULT_MIN_BALANCE * Run pre-commit hooks --- CODEOWNERS | 2 -- scripts/s3BucketOptions/setBucketCORS.py | 2 ++ .../setBucketLifecyclePolicy.py | 2 ++ .../setBucketLifecyclePolicyCEPH.py | 2 ++ scripts/s3RobustCopy/main.py | 2 +- .../admin-panels/data/ProjectsQuestions.ipynb | 4 +-- services/batman-panels/main.py | 1 - services/monitoring/grafana/scripts/import.py | 32 +++++++++++++------ services/pg-backup/README.md | 4 +-- 9 files changed, 34 insertions(+), 17 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 6b7cfecd..9f2651a0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,5 +5,3 @@ # files and folders recursively * @mrnicegyu11 @YuryHrytsuk - - diff --git a/scripts/s3BucketOptions/setBucketCORS.py b/scripts/s3BucketOptions/setBucketCORS.py index 086cc8ec..04550863 100644 --- a/scripts/s3BucketOptions/setBucketCORS.py +++ b/scripts/s3BucketOptions/setBucketCORS.py @@ -8,6 +8,8 @@ "ignore", ".*Adding certificate verification is strongly advised.*", ) + + # def main( destinationbucketname: str, diff --git a/scripts/s3BucketOptions/setBucketLifecyclePolicy.py b/scripts/s3BucketOptions/setBucketLifecyclePolicy.py index 24b14aad..16f4cd44 100644 --- a/scripts/s3BucketOptions/setBucketLifecyclePolicy.py +++ b/scripts/s3BucketOptions/setBucketLifecyclePolicy.py @@ -8,6 +8,8 @@ "ignore", ".*Adding certificate verification is strongly advised.*", ) + + # def main( destinationbucketname: str, diff --git a/scripts/s3BucketOptions/setBucketLifecyclePolicyCEPH.py b/scripts/s3BucketOptions/setBucketLifecyclePolicyCEPH.py index 00ae47d9..ddee34e4 100644 --- a/scripts/s3BucketOptions/setBucketLifecyclePolicyCEPH.py +++ b/scripts/s3BucketOptions/setBucketLifecyclePolicyCEPH.py @@ -8,6 +8,8 @@ "ignore", ".*Adding certificate verification is strongly advised.*", ) + + # def main( destinationbucketname: str, diff --git a/scripts/s3RobustCopy/main.py b/scripts/s3RobustCopy/main.py index bec60c1d..2f3eca12 100644 --- a/scripts/s3RobustCopy/main.py +++ b/scripts/s3RobustCopy/main.py @@ -29,6 +29,7 @@ ) # + ############ ############ Common functionality def isObjectPresentOnBucket(botobucket, filepath, allObjectsBucket=None): @@ -223,7 +224,6 @@ def main( decryption: bool = typer.Option(False, "--decryption"), password: str = "", ): - if nooverwrites: print("CONFIG: WILL NOT OVERWRITE ANY FILES.") if (encryption or decryption) and password != "": diff --git a/services/admin-panels/data/ProjectsQuestions.ipynb b/services/admin-panels/data/ProjectsQuestions.ipynb index 4fc6dcf9..5a39f7f1 100644 --- a/services/admin-panels/data/ProjectsQuestions.ipynb +++ b/services/admin-panels/data/ProjectsQuestions.ipynb @@ -114,9 +114,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "", "language": "python", - "name": "python3" + "name": "" }, "language_info": { "codemirror_mode": { diff --git a/services/batman-panels/main.py b/services/batman-panels/main.py index 4f9aca49..7784c77f 100644 --- a/services/batman-panels/main.py +++ b/services/batman-panels/main.py @@ -350,7 +350,6 @@ def runTableGeneration(): assert len(branches) == len(test_repo_ids) for gitlabID_iter in range(len(test_repo_ids)): # e2e p2e opse2e ... - gitlabID = test_repo_ids[gitlabID_iter] gitlabName = test_repo_names[gitlabID_iter] dictListTestResultsNow = [] diff --git a/services/monitoring/grafana/scripts/import.py b/services/monitoring/grafana/scripts/import.py index a5f9dba6..24ccf52c 100644 --- a/services/monitoring/grafana/scripts/import.py +++ b/services/monitoring/grafana/scripts/import.py @@ -2,8 +2,8 @@ import json import os import time -from pathlib import Path import warnings +from pathlib import Path import requests import typer @@ -180,7 +180,9 @@ def main(foldername: str = "", overwrite: bool = True): r = session.get(url + "datasources", headers=hed, verify=False) for i in r.json(): print("Deleting datasource " + str(i["uid"]) + " - " + str(i["name"])) - r = session.delete(url + "datasources/uid/" + str(i["uid"]), headers=hed, verify=False) + r = session.delete( + url + "datasources/uid/" + str(i["uid"]), headers=hed, verify=False + ) print("Response: ", r.status_code) listOfDatasources = [] for file in directoriesDatasources: @@ -205,7 +207,9 @@ def main(foldername: str = "", overwrite: bool = True): jsonObjectDatasource["url"] = "http://prometheus:" + env.str( "MONITORING_PROMETHEUS_PORT" ) - r = session.post(url + "datasources", json=jsonObjectDatasource, headers=hed, verify=False) + r = session.post( + url + "datasources", json=jsonObjectDatasource, headers=hed, verify=False + ) objectToKeepTrack = { "name": jsonObjectDatasource["name"], "uid": jsonObjectDatasource["uid"], @@ -265,10 +269,14 @@ def main(foldername: str = "", overwrite: bool = True): # Get all datasources r = session.get(url + "folders", headers=hed, verify=False) for i in r.json(): - r = session.delete(url + "folders/" + str(i["uid"]), headers=hed, verify=False) + r = session.delete( + url + "folders/" + str(i["uid"]), headers=hed, verify=False + ) print("Adding folders") for directoryData in directoriesData: - r = session.post(url + "folders", json={"title": directoryData}, headers=hed, verify=False) + r = session.post( + url + "folders", json={"title": directoryData}, headers=hed, verify=False + ) if r.status_code != 200: print("Received non-200 status code upon import: ", str(r.status_code)) print("JSON file failed uploading:") @@ -312,7 +320,9 @@ def main(foldername: str = "", overwrite: bool = True): dashboard["Dashboard"]["id"] = "null" dashboard["overwrite"] = True dashboard["folderId"] = folderID - r = session.post(url + "dashboards/db", json=dashboard, headers=hed, verify=False) + r = session.post( + url + "dashboards/db", json=dashboard, headers=hed, verify=False + ) if r.status_code != 200: print( @@ -407,8 +417,9 @@ def main(foldername: str = "", overwrite: bool = True): mailAddressProvisioningJSON if grafanaAlertingMailTarget else slackWebhookProvisioningJSON - ), verify=False, - headers=hed + ), + verify=False, + headers=hed, ) if r.status_code != 202: print( @@ -475,7 +486,10 @@ def main(foldername: str = "", overwrite: bool = True): print("Add alerts " + jsonObject["name"]) r = session.post( - url + "ruler/grafana/api/v1/rules/ops", json=jsonObject, headers=hed, verify=False + url + "ruler/grafana/api/v1/rules/ops", + json=jsonObject, + headers=hed, + verify=False, ) # with open(directory + "/debug.json", 'w') as outfile: # json.dump(jsonObject, outfile, sort_keys=True, indent=2) diff --git a/services/pg-backup/README.md b/services/pg-backup/README.md index 7fafdd66..76155116 100644 --- a/services/pg-backup/README.md +++ b/services/pg-backup/README.md @@ -46,7 +46,7 @@ WHERE DROP DATABASE simcoredb; quit ``` -- Finally, restore the DB : +- Finally, restore the DB : ``` psql simcoredb < /PG_osparc-master.speag.com_simcoredb.05-March-2023.dmp -``` \ No newline at end of file +```