Update deprecated mongoimport code

Signed-off-by: coleramos425 <colramos@amd.com>
Ta zmiana jest zawarta w:
Cole Ramos authored and GitHub committed 2023-01-23 13:53:39 -06:00
1 rodzic 7b4adc5bc0
złożenie 227760ce1c
Plik 1 zmieniony
+5 -4
+5 -4
Wyświetl plik
@@ -224,27 +224,28 @@ def convert_folder(connectionInfo, Extractionlvl):
df_saved_file = t2.to_csv(newfilepath + file)
cmd = (
'mongoimport --quiet --uri mongodb://{}:{}@{}:{} --authenticationDatabase "admin" --file {} -d {} -c {} --drop --type csv --headerline'
'mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline'
).format(
connectionInfo["username"],
connectionInfo["password"],
connectionInfo["host"],
connectionInfo["port"],
newfilepath + file,
connectionInfo["db"],
newfilepath + file,
fileName,
)
os.system(cmd)
else:
cmd = (
'mongoimport --quiet --uri mongodb://{}:{}@{}:{} --authenticationDatabase "admin" --file {} -d {} -c {} --drop --type csv --headerline'
'mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline'
).format(
connectionInfo["username"],
connectionInfo["password"],
connectionInfo["host"],
connectionInfo["port"],
connectionInfo["workload"] + "/" + file,
connectionInfo["db"],
connectionInfo["workload"] + "/" + file,
fileName,
)
os.system(cmd)