Skip to content

Commit

Permalink
Merge pull request #1079 from openWB/revert-968-Onedrive_Backup
Browse files Browse the repository at this point in the history
Revert "Onedrive_Backup"
  • Loading branch information
LKuemmel authored Aug 4, 2023
2 parents 25e6664 + bb1ffce commit 1ff6804
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 526 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest paho-mqtt requests-mock jq pyjwt==2.6.0 bs4 pkce typing_extensions python-dateutil==2.8.2 msal
pip install flake8 pytest paho-mqtt requests-mock jq pyjwt==2.6.0 bs4 pkce typing_extensions python-dateutil==2.8.2
- name: Flake8 with annotations in packages folder
uses: TrueBrain/actions-flake8@v2.1
with:
Expand Down
27 changes: 0 additions & 27 deletions packages/helpermodules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
import traceback
from pathlib import Path
import paho.mqtt.client as mqtt

from control.chargepoint import chargepoint
from control.chargepoint.chargepoint_template import get_autolock_plan_default, get_chargepoint_template_default
from modules.backup_clouds.onedrive.api import generateMSALAuthCode, retrieveMSALTokens

from helpermodules import measurement_log
from helpermodules.broker import InternalBrokerClient
Expand All @@ -30,7 +28,6 @@
import dataclass_utils
from modules.common.configurable_vehicle import IntervalConfig


log = logging.getLogger(__name__)


Expand Down Expand Up @@ -698,30 +695,6 @@ def restoreBackup(self, connection_id: str, payload: dict) -> None:
f'Restore-Status: {result.returncode}<br />Meldung: {result.stdout.decode("utf-8")}',
MessageType.ERROR)

def requestMSALAuthCode(self, connection_id: str, payload: dict) -> None:
''' fordert einen Authentifizierungscode für MSAL (Microsoft Authentication Library)
an um Onedrive Backup zu ermöglichen'''
cloudbackupconfig = SubData.system_data["system"].backup_cloud
if cloudbackupconfig is None:
pub_user_message(payload, connection_id,
"Es ist keine Backup-Cloud konfiguriert. Bitte Konfiguration speichern "
"und erneut versuchen.<br />", MessageType.WARNING)
return
result = generateMSALAuthCode(cloudbackupconfig.config)
pub_user_message(payload, connection_id, result["message"], result["MessageType"])

def retrieveMSALTokens(self, connection_id: str, payload: dict) -> None:
""" holt die Tokens für MSAL (Microsoft Authentication Library) um Onedrive Backup zu ermöglichen
"""
cloudbackupconfig = SubData.system_data["system"].backup_cloud
if cloudbackupconfig is None:
pub_user_message(payload, connection_id,
"Es ist keine Backup-Cloud konfiguriert. Bitte Konfiguration speichern "
"und erneut versuchen.<br />", MessageType.WARNING)
return
result = retrieveMSALTokens(cloudbackupconfig.config)
pub_user_message(payload, connection_id, result["message"], result["MessageType"])

def factoryReset(self, connection_id: str, payload: dict) -> None:
Path(Path(__file__).resolve().parents[2] / 'data' / 'restore' / 'factory_reset').touch()
pub_user_message(payload, connection_id,
Expand Down
Empty file.
170 changes: 0 additions & 170 deletions packages/modules/backup_clouds/onedrive/api.py

This file was deleted.

42 changes: 0 additions & 42 deletions packages/modules/backup_clouds/onedrive/backup_cloud.py

This file was deleted.

30 changes: 0 additions & 30 deletions packages/modules/backup_clouds/onedrive/config.py

This file was deleted.

3 changes: 0 additions & 3 deletions packages/modules/backup_clouds/onedrive/msdrive/constants.py

This file was deleted.

Loading

0 comments on commit 1ff6804

Please sign in to comment.