Fix exception thrown if no config file exists, that's no error.
authorMichael Andres <ma@suse.de>
Tue, 27 Aug 2013 15:25:03 +0000 (17:25 +0200)
committerMichael Andres <ma@suse.de>
Tue, 27 Aug 2013 15:25:03 +0000 (17:25 +0200)
src/utils/Augeas.cc

index 3320346..4950b16 100644 (file)
@@ -93,16 +93,10 @@ Augeas::Augeas(const string & file)
     }
   }
 
-  if (!_got_global_zypper_conf && !_got_user_zypper_conf)
+  if (!_got_global_zypper_conf && !_got_user_zypper_conf && !error.empty() )
   {
-    if (error.empty())
-      ZYPP_THROW(Exception(
-          _("No configuration file exists or could be parsed.")));
-    else
-    {
-      string msg = _("Error parsing zypper.conf:") + string("\n") + error;
-      ZYPP_THROW(Exception(msg));
-    }
+    string msg = _("Error parsing zypper.conf:") + string("\n") + error;
+    ZYPP_THROW(Exception(msg));
   }
 
   MIL << "Done reading conf files:" << endl;