summaryrefslogtreecommitdiff
path: root/ovn/controller/ovn-controller.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@ovn.org>2016-04-07 11:26:21 -0400
committerRussell Bryant <russell@ovn.org>2016-04-14 17:02:20 -0400
commit14e2ba58c594bd0645d388a57ddf3b7b9024af07 (patch)
tree7be20ac92b44b11fad474cf7a72e69a9c8d86b44 /ovn/controller/ovn-controller.c
parentfbeb0f3f0798033b72e386723e4b6d5bfd3f4e74 (diff)
downloadopenvswitch-14e2ba58c594bd0645d388a57ddf3b7b9024af07.tar.gz
ovn-controller: Warn if system-id is missing.
If 'system-id' is missing from the Open_vSwitch database, ovn-controller will not work. Log a warning if that happens to make it clear that configuration is incomplete. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn/controller/ovn-controller.c')
-rw-r--r--ovn/controller/ovn-controller.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index fc45d6439..c47492e6b 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -190,7 +190,14 @@ static const char *
get_chassis_id(const struct ovsdb_idl *ovs_idl)
{
const struct ovsrec_open_vswitch *cfg = ovsrec_open_vswitch_first(ovs_idl);
- return cfg ? smap_get(&cfg->external_ids, "system-id") : NULL;
+ const char *chassis_id = cfg ? smap_get(&cfg->external_ids, "system-id") : NULL;
+
+ if (!chassis_id) {
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
+ VLOG_WARN_RL(&rl, "'system-id' in Open_vSwitch database is missing.");
+ }
+
+ return chassis_id;
}
/* Retrieves the OVN Southbound remote location from the