aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-10-01 11:09:38 -0700
committerBen Pfaff <blp@nicira.com>2015-10-16 20:15:08 -0700
commitcb08edc691d863dbac4327fc6c85c6fc2a408e1c (patch)
tree0c75937ce934c8a52e283d2cfb9c8b96d2185c50
parenta1d210a64f2b5a2661256aa50c200bf6ac1f3373 (diff)
patch: Bail out earlier if OVS IDL transactions cannot be executed.
The whole point of this module is side effects on the Open vSwitch database, so the whole thing can be skipped if those are impossible. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
-rw-r--r--ovn/controller/patch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ovn/controller/patch.c b/ovn/controller/patch.c
index 0d192fa89..1cce5594f 100644
--- a/ovn/controller/patch.c
+++ b/ovn/controller/patch.c
@@ -69,10 +69,6 @@ create_patch_port(struct controller_ctx *ctx,
const struct ovsrec_bridge *b1,
const struct ovsrec_bridge *b2)
{
- if (!ctx->ovs_idl_txn) {
- return;
- }
-
char *port_name = patch_port_name(b1, b2);
char *peer_port_name = patch_port_name(b2, b1);
@@ -218,6 +214,10 @@ parse_bridge_mappings(struct controller_ctx *ctx,
void
patch_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int)
{
+ if (!ctx->ovs_idl_txn) {
+ return;
+ }
+
const char *mappings_cfg = "";
const struct ovsrec_open_vswitch *cfg;