[Kimchi-devel] [PATCH] error when editing repository entry with no mirrorlist.

Paulo Vital pvital at linux.vnet.ibm.com
Fri Apr 11 03:11:40 UTC 2014


After edit a repository entry that contains only the baseurl field,
the new content of the entry will not be stored due to an error when
using '' string to the mirrorlist field.

 File "/home/pvital/git/kimchi-test-upstream/src/kimchi/repositories.py", line 267, in updateRepo
entry.mirrorlist = mirrorlist
File "/usr/lib/python2.7/site-packages/yum/config.py", line 102, in __set__
  value, str(e)))
ValueError: Error parsing "mirrorlist = u''": URL must be http, ftp, file or https not ""

This patch fixes the issue with a verification of the mirrorlist
before process it.

Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
---
 src/kimchi/repositories.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index ba432ef..414f146 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -262,6 +262,9 @@ class YumRepo(object):
         if baseurl is not None:
             entry.baseurl = baseurl
 
+        if mirrorlist == '':
+            mirrorlist = None
+
         if mirrorlist is not None:
             entry.mirrorlist = mirrorlist
 
-- 
1.8.3.1




More information about the Kimchi-devel mailing list