md5sum_uploaded_file=r.text# get md5 sum of the uploaded file
md5sum_uploaded_file=r.text# get md5 sum of the uploaded file
ifhas_bucket_key_res=='True':
ifhas_bucket_key_res=='True':
ifmd5sum_local_file==md5sum_uploaded_file:
ifmd5sum_local_file==md5sum_uploaded_file:
print("UPLOADED")
ifdelete_uploadedisTrue:
os.remove(path)
print("UPLOADED and DELETED")
else:
print("UPLOADED")
else:
else:
print("File is uploaded BUT md5sum is Different")
print("File is uploaded BUT md5sum is Different")
diff_md5sum_list.append(path)
diff_md5sum_list.append(path)
...
@@ -67,6 +72,7 @@ if __name__ == "__main__":
...
@@ -67,6 +72,7 @@ if __name__ == "__main__":
parser=argparse.ArgumentParser(description='Test if all files are uploaded')
parser=argparse.ArgumentParser(description='Test if all files are uploaded')
parser.add_argument("-b","--base_path",help="Base path of the files to be uploaded, e.g. /mic/syscomtestuser/syscom/SYSCOM02-12400555/background",required=True,default="")
parser.add_argument("-b","--base_path",help="Base path of the files to be uploaded, e.g. /mic/syscomtestuser/syscom/SYSCOM02-12400555/background",required=True,default="")
parser.add_argument("-f","--file_expression",help='File expression of the files to be uploaded, e.g. "*/*/*.BMR"',required=True,default="")
parser.add_argument("-f","--file_expression",help='File expression of the files to be uploaded, e.g. "*/*/*.BMR"',required=True,default="")
parser.add_argument("-d","--delete_uploaded",help="Delete files on local file system which are uploaded an have same md5sum on server as locally",action='store_true')
parser.add_argument("-u","--url",help="Request url to data bucket stream, e.g. https://monitoring.woelfel.de/neo-erp5/data_stream_module/26",required=True,default="")
parser.add_argument("-u","--url",help="Request url to data bucket stream, e.g. https://monitoring.woelfel.de/neo-erp5/data_stream_module/26",required=True,default="")