Ejemplo n.º 1
0
    def _check_repo(self, base_url, suite):
        release_url = '{base_url}/dists/{suite}/Release'.format(
            base_url=base_url, suite=suite)
        host = urlparse.urlparse(release_url).netloc.split(':')[0]
        if (localhost_pattern.search(host) and utils.is_pre_deployment()):
            # Due to pre-deployment stage we can't check accessibility of local
            # repository since it is not created at that moment. Although we
            # still should provide an ability to use it, because in fact
            # it will be created at the end of deployment.
            log.warning('Accessibility check is skipped for local '
                        'repository: {}'.format(release_url))
            return True

        return self.check_url(release_url)
Ejemplo n.º 2
0
    def _check_repo(self, base_url, suite, proxies):
        release_url = '{base_url}/dists/{suite}/Release'.format(
            base_url=base_url, suite=suite)
        if (local_repo_pattern.search(release_url)
                and utils.is_pre_deployment()):
            # Due to pre-deployment stage we can't check accessibility of local
            # repository since it is not created at that moment. Although we
            # still should provide an ability to use it, because in fact
            # it will be created at the end of deployment.
            log.warn('Accessibility check is skipped for local repository: %s',
                     release_url)
            return True

        return self.check_url(release_url, proxies)
Ejemplo n.º 3
0
    def _check_repo(self, base_url, suite, proxies):
        release_url = '{base_url}/dists/{suite}/Release'.format(
            base_url=base_url, suite=suite)
        if (local_repo_pattern.search(release_url) and
                utils.is_pre_deployment()):
            # Due to pre-deployment stage we can't check accessibility of local
            # repository since it is not created at that moment. Although we
            # still should provide an ability to use it, because in fact
            # it will be created at the end of deployment.
            log.warn('Accessibility check is skipped for local repository: %s',
                     release_url)
            return True

        return self.check_url(release_url, proxies)
Ejemplo n.º 4
0
 def test_is_pre_deployment(self, utils_mock):
     utils_mock.return_value = "pre"
     data = utils.is_pre_deployment()
     self.assertEqual(data, True)
Ejemplo n.º 5
0
 def test_is_pre_deployment(self, utils_mock):
     utils_mock.return_value = "pre"
     data = utils.is_pre_deployment()
     self.assertEqual(data, True)