ovsdb-doc: Support per-element documentation of string sets.
authorEthan Jackson <ethan@nicira.com>
Thu, 9 Feb 2012 00:26:57 +0000 (16:26 -0800)
committerEthan Jackson <ethan@nicira.com>
Thu, 9 Feb 2012 05:26:29 +0000 (21:26 -0800)
A future patch will need to document individual elements in a set
of strings.  Without this patch the documentation generation code
fails trying to figure out what type the value of the map is.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ovsdb/ovsdb-doc.in

index 53292b33be29389294a4d5091ec1dd5b6e1f1306..8f725d7901155f2f069151973cc7ea6878d635a8 100755 (executable)
@@ -185,22 +185,27 @@ def columnGroupToNroff(table, groupXml):
                     type_ = column.type.value
 
                 nameNroff = "%s : %s" % (name, key)
-                typeNroff = "optional %s" % column.type.value.toEnglish()
-                if (column.type.value.type == ovs.db.types.StringType and
-                    type_.type == ovs.db.types.BooleanType):
-                    # This is a little more explicit and helpful than
-                    # "containing a boolean"
-                    typeNroff += r", either \fBtrue\fR or \fBfalse\fR"
+
+                if column.type.value:
+                    typeNroff = "optional %s" % column.type.value.toEnglish()
+                    if (column.type.value.type == ovs.db.types.StringType and
+                        type_.type == ovs.db.types.BooleanType):
+                        # This is a little more explicit and helpful than
+                        # "containing a boolean"
+                        typeNroff += r", either \fBtrue\fR or \fBfalse\fR"
+                    else:
+                        if type_.type != column.type.value.type:
+                            type_english = type_.toEnglish()
+                            if type_english[0] in 'aeiou':
+                                typeNroff += ", containing an %s" % type_english
+                            else:
+                                typeNroff += ", containing a %s" % type_english
+                        constraints = (
+                            type_.constraintsToEnglish(escapeNroffLiteral))
+                        if constraints:
+                            typeNroff += ", %s" % constraints
                 else:
-                    if type_.type != column.type.value.type:
-                        type_english = type_.toEnglish()
-                        if type_english[0] in 'aeiou':
-                            typeNroff += ", containing an %s" % type_english
-                        else:
-                            typeNroff += ", containing a %s" % type_english
-                    constraints = type_.constraintsToEnglish(escapeNroffLiteral)
-                    if constraints:
-                        typeNroff += ", %s" % constraints
+                    typeNroff = "none"
             else:
                 nameNroff = name
                 typeNroff = typeAndConstraintsToNroff(column)