[filescanner] use configparser
This commit is contained in:
parent
b235f0833c
commit
00563c7dc2
2 changed files with 14 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ import time
|
|||
from uuid import uuid4
|
||||
|
||||
from . import logger
|
||||
from ucloud.config import env_vars, etcd_client
|
||||
from ucloud.config import config, etcd_client
|
||||
|
||||
|
||||
def getxattr(file, attr):
|
||||
|
|
@ -37,7 +37,7 @@ def setxattr(file, attr, value):
|
|||
|
||||
def sha512sum(file: str):
|
||||
"""Use sha512sum utility to compute sha512 sum of arg:file
|
||||
|
||||
|
||||
IF arg:file does not exists:
|
||||
raise FileNotFoundError exception
|
||||
ELSE IF sum successfully computer:
|
||||
|
|
@ -69,9 +69,8 @@ except Exception as e:
|
|||
|
||||
|
||||
def main():
|
||||
BASE_DIR = env_vars.get("BASE_DIR")
|
||||
|
||||
FILE_PREFIX = env_vars.get("FILE_PREFIX")
|
||||
BASE_DIR = config['storage']["FILE_DIR"]
|
||||
FILE_PREFIX = config['storage']["FILE_PREFIX"]
|
||||
|
||||
# Recursively Get All Files and Folder below BASE_DIR
|
||||
files = glob.glob("{}/**".format(BASE_DIR), recursive=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue