ovn-nbctl: Help catch lport-set-addresses mistakes.
authorRussell Bryant <russell@ovn.org>
Thu, 14 Jan 2016 15:47:18 +0000 (10:47 -0500)
committerRussell Bryant <russell@ovn.org>
Thu, 21 Jan 2016 14:07:59 +0000 (09:07 -0500)
commit5761980d53c025ab73839624ea25bce30a94e80f
tree33ec2083ad4eece6a3f22f858dc5ad2a5ca61630
parent9fd52392dae1d958b1d9154cf06b91871cdd9e3d
ovn-nbctl: Help catch lport-set-addresses mistakes.

While debugging a broken OVN environment yesterday, the problem turned
out to be invalid entries in the logical port addresses column.  In
particular, the following command had been used:

  $ ovn-nbctl lport-set-addresses lp0 MAC IP

instead of:

  $ ovn-nbctl lport-set-addresses lp0 "MAC IP"

This is really easy to mess up, so add some simple validation to the
lport-set-addresses command.  If the beginning of an argument is ever
an IP address, it's wrong.

In passing, also add a note to the ovn-nb db documentation to note that
the order of "MAC IP" is required, as "IP MAC" is not valid.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
ovn/ovn-nb.xml
ovn/utilities/ovn-nbctl.c