blob: e118d54389236f21e8850659f45b15f7e97ec4df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# vim: set sw=4 sts=4 et :
# Copyright: 2008 Gentoo Foundation
# Author(s): Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
# License: GPL-2
#
# Immortal lh!
#
import random
from ..models import Mirror
def generate_stage_url(job):
mirror = random.choice(Mirror.objects.list(owner=job.provider))
url = mirror.server+mirror.prefix+mirror.structure
data['owner'] = mirror.owner.name
data['stage'] = job.stage.name
data['arch'] = job.arch.specific
data['gen_arch'] = job.arch.generic
data['release'] = job.release.name
url = url % data
return url
|