Commit b794915d by BoxuanXu

editer wrong code

1 parent ebc6f09b
Showing with 9 additions and 11 deletions
......@@ -102,22 +102,20 @@ def get_path_from_db(modelid,seetanet_model):
def upload_filetoFastDFS(params_name, graph_name,seetanet_model):
#upload seetanet file to fastdfs
seetanet_model_id = stbf_up(seetanet_model)
if(seetanet_model_id):
logging.info("upload seetanet file success,seetanet model_id is %s" % seetanet_model_id)
stmodel_fid = stbf_up(seetanet_model)
if(stmodel_fid):
logging.info("upload seetanet file success,seetanet model_id is %s" % stmodel_fid)
else:
logging.info("upload seetanet file failed!")
return None
return seetanet_model_id
return stmodel_fid
def update_pkg_info_db(sdk_fid,seetanet_model_id):
#seetanet_model_id = "group2/M00/00/04/wKgB61l-xXKARFT0AAANtlf6yRo13.json"
def update_pkg_info_db(modelid,sdk_fid,stmodel_fid):
#update pkg info table
logging.info("begin insert model_id ,sdk_fid,mxnet_modelid into pkg_info table")
sql_cmd = "insert into seetaAtlas.pkg_info (modelid,sdk_fid,stmodel_fid) values(" + str(mxnet_modelid) +",\'" + sdk_fid + "\',\'" + seetanet_model_id + "\')"
sql_cmd = "insert into seetaAtlas.pkg_info (modelid,sdk_fid,stmodel_fid) values(" + str(modelid) +",\'" + sdk_fid + "\',\'" + stmodel_fid + "\')"
curl_atlas_exe.execute(sql_cmd)
db_atlas.commit()
......@@ -139,13 +137,13 @@ def Dirver_Convert():
if params_name is None or graph_name is None:
logging.info("get wrong params file")
else:
seetanet_model_id = upload_filetoFastDFS(params_name, graph_name,seetanet_model)
stmodel_fid = upload_filetoFastDFS(params_name, graph_name,seetanet_model)
if seetanet_model_id is None:
if stmodel_fid is None:
logging.info("upload filed")
else:
sdk_fid = "group2/M00/00/04/wKgB61l-xXKARFT0AAANtlf6yRo13.json"
update_pkg_info_db(sdk_fid,seetanet_model_id)
update_pkg_info_db(modelid,sdk_fid,stmodel_fid)
logging.info("successfully,Finish!")
finally:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!