This still needs a review.
On Sat, Mar 21, 2020 at 03:17:27PM -0700, Ben Pfaff wrote: > Fixes two problems. First, the plural of chassis is also chassis. > Second, for linguistic analysis we need to consider plain words, not > words that have (e.g.) \fB and \fR pasted into them for nroff output. > > This makes the OVN manpage for ovn-sb(5) talk about "set of Chassis" > not "set of Chassiss". > > Signed-off-by: Ben Pfaff <[email protected]> > --- > python/ovs/db/types.py | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py > index b0eec6165b3b..a8ba01d4f2cc 100644 > --- a/python/ovs/db/types.py > +++ b/python/ovs/db/types.py > @@ -591,9 +591,16 @@ class Type(object): > if self.value: > return "map of %s%s-%s pairs" % (quantity, keyName, > valueName) > else: > - if keyName.lower() == 'chassis': > - plural = '' > - elif keyName.endswith('s'): > + # Exract the last word from 'keyName' so we can make it > plural. > + # For linguistic analysis, turn it into English without > + # formatting so that we don't consider any prefix or suffix > + # added by escapeLiteral. > + plainKeyName = (self.key.toEnglish(returnUnchanged) > + .rpartition(' ')[2].lower()) > + > + if plainKeyName == 'chassis': > + plural = keyName > + elif plainKeyName.endswith('s'): > plural = keyName + "es" > else: > plural = keyName + "s" > -- > 2.24.1 > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
