def check_file(file):
pattern = r'^/.*/hotswap.zip$'
file_with_full_path = '/app/online/{}{}'.format(GAME, file)
file_path = os.path.dirname(file_with_full_path)
pattern_matched = (re.match(pattern, file), 'Hotswap filename should be hotswap.zip')
with quiet():
file_exists = (local('test -f {}'.format(file_with_full_path)).succeeded, '{} does NOT exists on FTP, please check'.format(file))
md5_exists = (local('test -f {}/md5.txt'.format(file_path)).succeeded, 'md5.txt does NOT exists on FTP, please check')
for each_check in [pattern_matched, file_exists, md5_exists]:
if each_check[0]:
pass
else:
raise Exception(each_check[1])
评论列表
文章目录