[Kimchi-devel] [PATCH 2/3] Expands all possible variables in a repo url to validate it
Jose Ricardo Ziviani
joserz at linux.vnet.ibm.com
Thu Sep 10 19:23:27 UTC 2015
- the url will be validated even if it has variables in it.
Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
src/kimchi/repositories.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index 8f99a88..7689151 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -30,7 +30,7 @@ from kimchi.exception import InvalidOperation, InvalidParameter
from kimchi.exception import OperationFailed, NotFoundError, MissingParameter
from kimchi.utils import validate_repo_url
from kimchi.yumparser import get_yum_repositories, write_repo_to_file
-from kimchi.yumparser import get_display_name
+from kimchi.yumparser import get_display_name, get_expanded_url
class Repositories(object):
@@ -178,13 +178,13 @@ class YumRepo(object):
raise MissingParameter("KCHREPOS0013E")
if baseurl:
- validate_repo_url(baseurl)
+ validate_repo_url(get_expanded_url(baseurl))
if mirrorlist:
- validate_repo_url(mirrorlist)
+ validate_repo_url(get_expanded_url(mirrorlist))
if metalink:
- validate_repo_url(metalink)
+ validate_repo_url(get_expanded_url(metalink))
if mirrorlist and metalink:
raise InvalidOperation('KCHREPOS0030E')
@@ -278,15 +278,15 @@ class YumRepo(object):
raise MissingParameter("KCHREPOS0013E")
if baseurl is not None:
- validate_repo_url(baseurl)
+ validate_repo_url(get_expanded_url(baseurl))
entry.baseurl = baseurl
if mirrorlist is not None:
- validate_repo_url(mirrorlist)
+ validate_repo_url(get_expanded_url(mirrorlist))
entry.mirrorlist = mirrorlist
if metalink is not None:
- validate_repo_url(metalink)
+ validate_repo_url(get_expanded_url(metalink))
entry.metalink = metalink
if mirrorlist and metalink:
@@ -437,7 +437,7 @@ class AptRepo(object):
dist = config['dist']
comps = config.get('comps', [])
- validate_repo_url(uri)
+ validate_repo_url(get_expanded_url(uri))
kimchiLock.acquire()
try:
--
1.9.1
More information about the Kimchi-devel
mailing list