From 14e2ba58c594bd0645d388a57ddf3b7b9024af07 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 7 Apr 2016 11:26:21 -0400 Subject: 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 Acked-by: Ryan Moats Acked-by: Ben Pfaff --- ovn/controller/ovn-controller.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ovn/controller/ovn-controller.c') 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 -- cgit v1.2.1