[Kimchi-devel] [PATCH 07/10] bug fix: Let package manager tool create the repository ID

Aline Manera alinefm at linux.vnet.ibm.com
Tue Mar 18 17:04:12 UTC 2014


From: Aline Manera <alinefm at br.ibm.com>

The repository ID differs according to the repository type: deb or yum.
For yum repositories, the repository ID is kept in the repository
configuration file - so we can choose an arbitrary one as it will be
saved in a file.
But for a deb repository the ID does not exist. For internal proposals, we
build the ID for it based on url + dist + comps.

Signed-off-by: Aline Manera <alinefm at br.ibm.com>
---
 src/kimchi/model/host.py |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index e2a12de..7b151f2 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -325,21 +325,7 @@ class RepositoriesModel(object):
         if self.host_repositories is None:
             raise InvalidOperation('KCHREPOS0014E')
 
-        repo_id = params.get('repo_id', None)
-
-        # Create a repo_id if not given by user. The repo_id will follow
-        # the format kimchi_repo_<integer>, where integer is the number of
-        # seconds since the Epoch (January 1st, 1970), in UTC.
-        if repo_id is None:
-            repo_id = "kimchi_repo_%s" % int(time.time())
-            while repo_id in self.get_list():
-                repo_id = "kimchi_repo_%s" % int(time.time())
-            params.update({'repo_id': repo_id})
-
-        if repo_id in self.get_list():
-            raise InvalidOperation("KCHREPOS0006E", {'repo_id': repo_id})
-        self.host_repositories.addRepository(params)
-        return repo_id
+        return self.host_repositories.addRepository(params)
 
 
 class RepositoryModel(object):
-- 
1.7.10.4




More information about the Kimchi-devel mailing list