예제 #1
0
    def addRepository(self, params):
        # Create and enable the repository
        repo_id = params['repo_id']
        config = params.get('config', {})
        repo = {'repo_id': repo_id,
                'baseurl': params.get('baseurl'),
                'enabled': True,
                'config': {'repo_name': config.get('repo_name', repo_id),
                           'gpgkey': config.get('gpgkey', []),
                           'gpgcheck': True,
                           'mirrorlist': config.get('mirrorlist', "")}
                }

        self._repos[repo_id] = repo
        return repo_id
예제 #2
0
파일: mockmodel.py 프로젝트: shaohef/kimchi
    def addRepository(self, params):
        # Create and enable the repository
        repo_id = params['repo_id']
        config = params.get('config', {})
        repo = {
            'repo_id': repo_id,
            'baseurl': params.get('baseurl'),
            'enabled': True,
            'config': {
                'repo_name': config.get('repo_name', repo_id),
                'gpgkey': config.get('gpgkey', []),
                'gpgcheck': True,
                'mirrorlist': config.get('mirrorlist', "")
            }
        }

        self._repos[repo_id] = repo
        return repo_id
예제 #3
0
    def _mock_repositories_create(self, params):
        # 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.
        repo_id = params.get('repo_id', None)
        if repo_id is None:
            repo_id = "kimchi_repo_%s" % str(int(time.time() * 1000))
            params.update({'repo_id': repo_id})

        config = params.get('config', {})
        info = {'repo_id': repo_id,
                'baseurl': params['baseurl'],
                'enabled': True,
                'config': {'repo_name': config.get('repo_name', repo_id),
                           'gpgkey': config.get('gpgkey', []),
                           'gpgcheck': True,
                           'mirrorlist': params.get('mirrorlist', '')}}
        self._mock_repositories.repos[repo_id] = info
        return repo_id
예제 #4
0
    def _mock_repositories_create(self, params):
        # 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.
        repo_id = params.get('repo_id', None)
        if repo_id is None:
            repo_id = "kimchi_repo_%s" % str(int(time.time() * 1000))
            params.update({'repo_id': repo_id})

        config = params.get('config', {})
        info = {'repo_id': repo_id,
                'baseurl': params['baseurl'],
                'enabled': True,
                'config': {'repo_name': config.get('repo_name', repo_id),
                           'gpgkey': config.get('gpgkey', []),
                           'gpgcheck': True,
                           'mirrorlist': params.get('mirrorlist', '')}}
        self._mock_repositories.repos[repo_id] = info
        return repo_id