X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tools%2Fdzombie.py;h=2095c96486a10fdd59f287e2c82d2c7d8bf4b545;hb=e70e20fdbececafef842ec7b330fd48db42e614e;hp=02a01bca58be0566eec81eb77e85c69c83f9d654;hpb=4eda0849ebcf47ab22aced4ae8d41707945982a3;p=plcapi.git diff --git a/tools/dzombie.py b/tools/dzombie.py index 02a01bc..2095c96 100755 --- a/tools/dzombie.py +++ b/tools/dzombie.py @@ -37,8 +37,11 @@ try: line = lines[index].strip() # find all created objects if line.startswith("CREATE"): - item_type = line.split(" ")[1].strip() - item_name = line.split(" ")[2].strip() + line_parts = line.split(" ") + if line_parts[1:3] == ['OR', 'REPLACE']: + line_parts = line_parts[2:] + item_type = line_parts[1].strip() + item_name = line_parts[2].strip() if item_type.upper() in ['TABLE']: while index < len(lines): index = index + 1 @@ -72,7 +75,7 @@ try: # do not delete from primary tables if foreign_key_parts[0] in ['addresses', 'boot_states', 'conf_files', \ - 'keys', 'messages', 'nodegroups', 'nodenetworks', 'nodes', 'pcus', 'peers' \ + 'keys', 'messages', 'nodegroups', 'interfaces', 'nodes', 'pcus', 'peers' \ 'persons', 'roles', 'sessions', 'sites', 'slices']: #print "skipping table %s" % foreign_key_parts[0] continue