Skip to content

Commit

Permalink
Update configHandler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hendriksen-mark committed Jul 24, 2024
1 parent 6a5f8e5 commit 84097b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BridgeEmulator/configManager/configHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from configManager.argumentHandler import parse_arguments
from datetime import datetime
import os
import pathlib
import subprocess
import json
import logManager
Expand Down Expand Up @@ -33,6 +34,7 @@ def _write_yaml(path, contents):
class Config:
yaml_config = None
configDir = parse_arguments()["CONFIG_PATH"]
runningDir = pathlib.Path(__file__).parent.resolve()

def __init__(self):
if not os.path.exists(self.configDir):
Expand Down Expand Up @@ -293,7 +295,7 @@ def download_config(self):

def download_log(self):
subprocess.run('tar -cvf ' + self.configDir + '/diyhue_log.tar ' +
'/*.log* ',
self.runningDir + '/*.log* ',
shell=True, capture_output=True, text=True)
return self.configDir + "/diyhue_log.tar"

Expand All @@ -314,7 +316,7 @@ def download_debug(self):
_write_yaml(self.configDir + "/system_info.yaml", info)
subprocess.run('tar --exclude=' + "'config.yaml'" + ' -cvf ' + self.configDir + '/config_debug.tar ' +
self.configDir + '/*.yaml ' +
'/*.log* ',
self.runningDir + '/*.log* ',
shell=True, capture_output=True, text=True)
os.popen('rm -r ' + self.configDir + '/config_debug.yaml')
return self.configDir + "/config_debug.tar"
Expand Down

0 comments on commit 84097b2

Please sign in to comment.