Blame SOURCES/BZ-1075708-yum-config-manager-config-file-update.patch

5b4f08
commit 2b617b86358aeedd3ed83fad0719cb0fada3241c
5b4f08
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5b4f08
Date:   Tue May 26 09:08:37 2015 +0200
5b4f08
5b4f08
    yum-config-manager: update config file specified using -c option. BZ#1075708
5b4f08
5b4f08
diff --git a/README b/README
5b4f08
index 8abe805..0c01d0e 100644
5b4f08
--- a/README
5b4f08
+++ b/README
5b4f08
@@ -67,3 +67,5 @@ Author of the update on boot init scripts
5b4f08
 - Tim Lauridsen
5b4f08
 Maintainer of yum-utils - fixer of a lot of misc utils.
5b4f08
 
5b4f08
+- Valentina Mukhamedzhanova
5b4f08
+Maintainer of yum-utils.
5b4f08
diff --git a/yum-config-manager.py b/yum-config-manager.py
5b4f08
index 380a54f..708c33f 100755
5b4f08
--- a/yum-config-manager.py
5b4f08
+++ b/yum-config-manager.py
5b4f08
@@ -155,10 +155,13 @@ if (not args and not opts.addrepo) or 'main' in args:
5b4f08
     print yb.fmtSection('main')
5b4f08
     print yb.conf.dump()
5b4f08
     if opts.save and hasattr(yb, 'main_setopts') and yb.main_setopts:
5b4f08
-        fn = '/etc/yum/yum.conf'
5b4f08
+        fn = opts.conffile
5b4f08
         if not os.path.exists(fn):
5b4f08
-            # Try the old default
5b4f08
-            fn = '/etc/yum.conf'
5b4f08
+            if fn == '/etc/yum/yum.conf':
5b4f08
+                # Try the old default
5b4f08
+                fn = '/etc/yum.conf'
5b4f08
+            else:
5b4f08
+                raise yum.Errors.ConfigError("Error accessing file for config %s" % fn)
5b4f08
         ybc = yb.conf
5b4f08
         writeRawConfigFile(fn, 'main', ybc.yumvar,
5b4f08
                            ybc.cfg.options, ybc.iteritems, ybc.optionobj,