diff --git a/utils/.updateObs.py.swp b/utils/.updateObs.py.swp deleted file mode 100644 index f31442a..0000000 Binary files a/utils/.updateObs.py.swp and /dev/null differ diff --git a/utils/updateObs.py b/utils/updateObs.py index 3409bfd..16fdeea 100644 --- a/utils/updateObs.py +++ b/utils/updateObs.py @@ -43,14 +43,15 @@ def addobs(file_path, status): #save videos break if not 'data' in status: os.remove(file_path) - return None + return 'can not get the status' status = status['data'] objectkey = os.path.basename(file_path) backups_path = os.sep.join([cfg.backups, status+'_'+objectkey]) time = os.path.basename(file_path).split('-')[0] if objectkey.split('.')[-1] in ['avi','mp4']: objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey - resp = obsClient.putFile(bucketName, objectkey, file_path) + if status == '02': + resp = obsClient.putFile(bucketName, objectkey, file_path) shutil.move(file_path, backups_path) #os.remove(file_path)