- for row in simple.itervalues():
- s = ("%03d: i=%s r=%s b=%s s=%s u=%s "
- "ia=%s ra=%s ba=%s sa=%s ua=%s uuid=%s"
- % (step, row.i, row.r, row.b, row.s, row.u,
- row.ia, row.ra, row.ba, row.sa, row.ua, row.uuid))
- s = re.sub('""|,|u?\'', "", s)
- s = re.sub('UUID\(([^)]+)\)', r'\1', s)
- s = re.sub('False', 'false', s)
- s = re.sub('True', 'true', s)
- s = re.sub(r'(ba)=([^[][^ ]*) ', r'\1=[\2] ', s)
- print(s)
- n += 1
-
- for row in l1.itervalues():
- s = ["%03d: i=%s k=" % (step, row.i)]
- if row.k:
- s.append(str(row.k.i))
- s.append(" ka=[")
- s.append(' '.join(sorted(str(ka.i) for ka in row.ka)))
- s.append("] l2=")
- if row.l2:
- s.append(str(row.l2[0].i))
- s.append(" uuid=%s" % row.uuid)
- print(''.join(s))
- n += 1
-
- for row in l2.itervalues():
- s = ["%03d: i=%s l1=" % (step, row.i)]
- if row.l1:
- s.append(str(row.l1.i))
- s.append(" uuid=%s" % row.uuid)
- print(''.join(s))
- n += 1
+ if "simple" in idl.tables:
+ simple_columns = ["i", "r", "b", "s", "u", "ia",
+ "ra", "ba", "sa", "ua", "uuid"]
+ simple = idl.tables["simple"].rows
+ for row in simple.itervalues():
+ s = "%03d:" % step
+ for column in simple_columns:
+ if hasattr(row, column) and not (type(getattr(row, column))
+ is ovs.db.data.Atom):
+ s += " %s=%s" % (column, getattr(row, column))
+ s = re.sub('""|,|u?\'', "", s)
+ s = re.sub('UUID\(([^)]+)\)', r'\1', s)
+ s = re.sub('False', 'false', s)
+ s = re.sub('True', 'true', s)
+ s = re.sub(r'(ba)=([^[][^ ]*) ', r'\1=[\2] ', s)
+ print(s)
+ n += 1
+
+ if "link1" in idl.tables:
+ l1 = idl.tables["link1"].rows
+ for row in l1.itervalues():
+ s = ["%03d: i=%s k=" % (step, row.i)]
+ if hasattr(row, "k") and row.k:
+ s.append(str(row.k.i))
+ if hasattr(row, "ka"):
+ s.append(" ka=[")
+ s.append(' '.join(sorted(str(ka.i) for ka in row.ka)))
+ s.append("] l2=")
+ if hasattr(row, "l2") and row.l2:
+ s.append(str(row.l2[0].i))
+ if hasattr(row, "uuid"):
+ s.append(" uuid=%s" % row.uuid)
+ print(''.join(s))
+ n += 1
+
+ if "link2" in idl.tables:
+ l2 = idl.tables["link2"].rows
+ for row in l2.itervalues():
+ s = ["%03d:" % step]
+ s.append(" i=%s l1=" % row.i)
+ if hasattr(row, "l1") and row.l1:
+ s.append(str(row.l1[0].i))
+ if hasattr(row, "uuid"):
+ s.append(" uuid=%s" % row.uuid)
+ print(''.join(s))
+ n += 1