Re: [ovs-dev] [PATCH 2/3] ovn-nbctl: Make error handling consistent with ovs-vsctl.

2016-05-08 Thread Ben Pfaff
On Sat, May 07, 2016 at 04:22:44PM -0700, Justin Pettit wrote: > > > On May 6, 2016, at 1:10 PM, Ben Pfaff wrote: > > > > @@ -448,10 +441,11 @@ nbctl_lswitch_add(struct ctl_context *ctx) > > static void > > nbctl_lswitch_del(struct ctl_context *ctx) > > { > > +bool must_exist = !shash_find(&

Re: [ovs-dev] [PATCH 2/3] ovn-nbctl: Make error handling consistent with ovs-vsctl.

2016-05-08 Thread Ben Pfaff
On Sat, May 07, 2016 at 04:10:28PM -0700, Justin Pettit wrote: > > > On May 6, 2016, at 1:10 PM, Ben Pfaff wrote: > > > > static void > > nbctl_lport_add(struct ctl_context *ctx) > > { > > -struct nbrec_logical_port *lport; > > +bool may_exist = shash_find(&ctx->options, "--may-exist") !

Re: [ovs-dev] [PATCH 2/3] ovn-nbctl: Make error handling consistent with ovs-vsctl.

2016-05-07 Thread Justin Pettit
> On May 6, 2016, at 1:10 PM, Ben Pfaff wrote: > > @@ -448,10 +441,11 @@ nbctl_lswitch_add(struct ctl_context *ctx) > static void > nbctl_lswitch_del(struct ctl_context *ctx) > { > +bool must_exist = !shash_find(&ctx->options, "--if-exists"); In addition to my previous comments, I just noti

Re: [ovs-dev] [PATCH 2/3] ovn-nbctl: Make error handling consistent with ovs-vsctl.

2016-05-07 Thread Justin Pettit
> On May 6, 2016, at 1:10 PM, Ben Pfaff wrote: > > static void > nbctl_lport_add(struct ctl_context *ctx) > { > -struct nbrec_logical_port *lport; > +bool may_exist = shash_find(&ctx->options, "--may-exist") != NULL; For the commands to which you added "--may-exist", it might be nice to

[ovs-dev] [PATCH 2/3] ovn-nbctl: Make error handling consistent with ovs-vsctl.

2016-05-06 Thread Ben Pfaff
ovs-vsctl distinguishes between internal database inconsistencies, which it logs, and errors in commands specified by the user, which cause fatal exits. ovn-nbctl wasn't as careful about this and tended to just log everything. This commit brings it up to the same standard as ovs-vsctl. This comm