aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-09-03 16:05:47 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-09-03 16:14:59 +0530
commitdbd60102af0cc4fc5a3a2581f9d37c3988a5f459 (patch)
tree824e1cc006b243b622a5b71002d6532abfab8e4d
parentSetup a sample job while syncing db (diff)
downloadautotua-dbd60102af0cc4fc5a3a2581f9d37c3988a5f459.tar.gz
autotua-dbd60102af0cc4fc5a3a2581f9d37c3988a5f459.tar.bz2
autotua-dbd60102af0cc4fc5a3a2581f9d37c3988a5f459.zip
Fix jobtage syncing during db init for remote repos
If const.JOBTAGE is a remote repository (only possible during testing), clone the jobtage tree first, *then* export
-rw-r--r--master/autotua/models.py15
-rwxr-xr-xmaster/setup-master.py1
2 files changed, 10 insertions, 6 deletions
diff --git a/master/autotua/models.py b/master/autotua/models.py
index ea39dd7..f5004a5 100644
--- a/master/autotua/models.py
+++ b/master/autotua/models.py
@@ -10,7 +10,7 @@ from django.db import models
from django.forms import ModelForm, ModelChoiceField
from django.contrib.auth.models import User
from autotua import jobuild, sync
-import const, random
+import const, random, urllib2
####################
### Models begin ###
@@ -131,13 +131,18 @@ class Job(models.Model):
Support multiple atoms for the multiple-save case
"""
- # FIXME: Re-implement using git-fuse?
- jobtagedir = '%s/jobtage-%s' % (const.TMPDIR, random.randint(0, 99999))
- sync.Syncer(scheme='git-export', uri=const.JOBTAGE, destdir=jobtagedir).sync()
+ tmpdir = '%s-%s' % (const.TMPDIR, random.randint(0, 99999))
+ jobtage_exportdir = '%s/jobtage-export' % tmpdir
+ jobtagedir = const.JOBTAGE
+ # If not a filesystem path, clone is required before an export
+ if not urllib2.splittype(jobtagedir)[0] in ['file', None]:
+ jobtagedir = '%s/jobtage' % tmpdir
+ sync.Syncer(scheme='git', uri=const.JOBTAGE, destdir=jobtagedir).sync()
+ sync.Syncer(scheme='git-export', uri=jobtagedir, destdir=jobtage_exportdir, rev=rev).sync()
deplist = []
for atom in atoms:
- resolver = jobuild.Resolver(jobuild.Jobuild(jobtagedir, atom))
+ resolver = jobuild.Resolver(jobuild.Jobuild(jobtage_exportdir, atom))
deplist.extend(resolver.resolve())
deplist.reverse()
# Fake jobuild.Resolver to get at _unique ;p
diff --git a/master/setup-master.py b/master/setup-master.py
index 3b2f3b1..4a6b67f 100755
--- a/master/setup-master.py
+++ b/master/setup-master.py
@@ -124,7 +124,6 @@ def setup_sample_job():
provider=job.provider)
job.release = Release.objects.get(name=sample_job['release'],
provider=job.provider)
- print job.atoms
job.save()
if len(sys.argv) < 3: