From bd9a033611fede9283f769005291722b2405cc1a Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Mar 31 2009 22:54:56 +0000 Subject: * src/drv_initscripts.c (get_augeas): when augeas has error, print warning --- diff --git a/src/drv_initscripts.c b/src/drv_initscripts.c index 7729f22..cd79795 100644 --- a/src/drv_initscripts.c +++ b/src/drv_initscripts.c @@ -135,9 +135,16 @@ static struct augeas *get_augeas(struct netcf *ncf) { ERR_THROW(r < 0, ncf, EOTHER, "failed to load config files"); /* FIXME: we need to produce _much_ better diagnostics here - need - to analyze what came back in /augeas//error */ + * to analyze what came back in /augeas//error; ultimately, we need + * to understand whether this is harmless or a real error. For real + * errors, we need to return an error. + */ r = aug_match(aug, "/augeas//error", NULL); - ERR_THROW(r != 0, ncf, EINTERNAL, "augeas setup failed"); + if (r > 0) { + fprintf(stderr, "warning: augeas initialization had errors\n"); + fprintf(stderr, "please file a bug with the following lines in the bug report:\n"); + aug_print(aug, stderr, "/augeas//error"); + } } return ncf->driver->augeas; error: