[netcf-devel] [PATCH 5/9] dutil_linux: don't bail if /augeas//error returned a match

Serge Hallyn serge.hallyn at canonical.com
Tue Mar 20 14:22:55 UTC 2012


after aug_load, unless errcode is something other than NETCF_NOERROR.
Without this, ncftool bails on debian early on.

Index: netcf-0.1.9/src/dutil_linux.c
===================================================================
--- netcf-0.1.9.orig/src/dutil_linux.c	2011-10-27 22:53:38.868758704 -0500
+++ netcf-0.1.9/src/dutil_linux.c	2011-10-27 22:54:01.908759594 -0500
@@ -387,7 +387,9 @@
             fprintf(stderr, "please file a bug with the following lines in the bug report:\n");
             aug_print(aug, stderr, "/augeas//error");
         }
-        ERR_THROW(r > 0, ncf, EOTHER, "errors in loading some config files");
+        if (r > 0 && ncf->errcode != NETCF_NOERROR) {
+            ERR_THROW(1, ncf, EOTHER, "errors in loading some config files");
+        }
         ncf->driver->load_augeas = 0;
     }
     return ncf->driver->augeas;


More information about the netcf-devel mailing list