Commit eaa378c7 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

style

parent a42b30bd
Pipeline #14240 passed with stage
in 2 minutes and 38 seconds
......@@ -491,12 +491,14 @@ class Repo(TimeStampedModel):
def api_req(self, url='', name=None, page=1):
logger.debug(f'requesting api {self.forge} {self.namespace} {self} {url}, page {page}')
try:
return httpx.get(self.api_url() + url, params={'page': page},
return httpx.get(self.api_url() + url,
params={'page': page},
verify=self.forge.verify,
headers=self.forge.headers())
except httpx.HTTPError:
logger.error(f'requesting api {self.forge} {self.namespace} {self} {url}, page {page} - SECOND TRY')
return httpx.get(self.api_url() + url, params={'page': page},
return httpx.get(self.api_url() + url,
params={'page': page},
verify=self.forge.verify,
headers=self.forge.headers())
......@@ -956,7 +958,8 @@ class Image(models.Model):
headers = {}
if not self.robotpkg.project.public:
image_name = self.get_image_name().split('/', maxsplit=1)[1].split(':')[0]
token = httpx.get(f'{self.robotpkg.project.main_forge.url}/jwt/auth', params={
token = httpx.get(f'{self.robotpkg.project.main_forge.url}/jwt/auth',
params={
'client_id': 'docker',
'offline_token': True,
'service': 'container_registry',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment