修改ftp传输代码
This commit is contained in:
@@ -37,12 +37,17 @@ class MainController(http.Controller):
|
||||
'password': maintenance_equipment.ftp_password
|
||||
}
|
||||
# 传输nc文件
|
||||
if transfer_nc_files(
|
||||
source_ftp_info,
|
||||
target_ftp_info,
|
||||
'/' + str(model_id),
|
||||
'/home/jikimo/testdir',
|
||||
end_with=tool_groups_id.name + '-all.nc'):
|
||||
return {'code': 200, 'message': 'success'}
|
||||
else:
|
||||
return {'code': 500, 'message': '传输失败'}
|
||||
try:
|
||||
result = transfer_nc_files(
|
||||
source_ftp_info,
|
||||
target_ftp_info,
|
||||
'/' + str(model_id),
|
||||
'/',
|
||||
match_str=r'^\d*_\d*-' + tool_groups_id.name + r'-\w{2}-all\.nc$'
|
||||
)
|
||||
if result:
|
||||
return {'code': 200, 'message': 'success'}
|
||||
else:
|
||||
return {'code': 404, 'message': '未找到编程文件'}
|
||||
except Exception as e:
|
||||
return {'code': 500, 'message': str(e)}
|
||||
|
||||
Reference in New Issue
Block a user