Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit c6934b25 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update fix_harvesters_collection to add a protection.

parent 60fa303d
......@@ -39,19 +39,21 @@ if __name__ == "__main__":
collections = row.collections
if row.host == "cds.cern.ch" and "," in collections:
print "\n\tsplit:", collections
data = row.as_dict()
del data["id"]
# insert new harvesters
for elt in collections.split(","):
print "\t\tinsert →", elt.strip()
data["collections"] = elt.strip()
db.harvesters.insert(**data)
# delete old harvesters
print "\t\tdelete →", row.id
del db.harvesters[row.id]
rep = raw_input("\n\tSplit '%s'? [y/N]: " % collections)
if rep == "y":
print "\n\tsplit:", collections
data = row.as_dict()
del data["id"]
# insert new harvesters
for elt in collections.split(","):
print "\t\tinsert →", elt.strip()
data["collections"] = elt.strip()
db.harvesters.insert(**data)
# delete old harvesters
print "\t\tdelete →", row.id
del db.harvesters[row.id]
# commit change
rep = raw_input("Commit database changes [y/N]: ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment