mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 11:04:15 +02:00
[api] refactoring: temp dir now follow the patter /tmp/bauh@vinicius
This commit is contained in:
@@ -5,7 +5,7 @@ from bauh.api.paths import CONFIG_PATH, TEMP_DIR, CACHE_PATH
|
||||
from bauh.commons import resource
|
||||
|
||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
BUILD_DIR = '{}/arch'.format(TEMP_DIR)
|
||||
BUILD_DIR = f'{TEMP_DIR}/arch'
|
||||
ARCH_CACHE_PATH = f'{CACHE_PATH}/arch'
|
||||
CATEGORIES_FILE_PATH = f'{ARCH_CACHE_PATH}/categories.txt'
|
||||
URL_CATEGORIES_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/categories.txt'
|
||||
|
||||
@@ -1656,7 +1656,7 @@ class ArchManager(SoftwareManager):
|
||||
version_files[ver] = file_path
|
||||
|
||||
versions.sort(reverse=True)
|
||||
extract_path = '{}/arch/history'.format(TEMP_DIR)
|
||||
extract_path = f'{TEMP_DIR}/arch/history'
|
||||
|
||||
try:
|
||||
Path(extract_path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -4,6 +4,7 @@ import traceback
|
||||
from logging import Logger
|
||||
from typing import Optional, Set, Tuple, Dict
|
||||
|
||||
from bauh.api.paths import TEMP_DIR
|
||||
from bauh.commons.system import new_root_subprocess
|
||||
|
||||
|
||||
@@ -24,7 +25,7 @@ def current_governors() -> Dict[str, Set[int]]:
|
||||
|
||||
|
||||
def set_governor(governor: str, root_password: str, cpu_idxs: Optional[Set[int]] = None):
|
||||
new_gov_file = '/tmp/bauh_scaling_governor'
|
||||
new_gov_file = f'{TEMP_DIR}/bauh_scaling_governor'
|
||||
with open(new_gov_file, 'w+') as f:
|
||||
f.write(governor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user