def save_location(self): l = Location() l.defaultlocation = True l.name = 'HomeTest' l.save() self.assertIsNotNone(l.id, 'Location id is None') return l
def test_save_method(self): l = Location() l.defaultlocation = True l.name = 'HomeTest' l.save() _id = l.id l = Location() l.defaultlocation = True l.name = 'HomeTest' l.save() for l in Location.objects.exclude(id=l.id): self.assertFalse(l.defaultlocation, 'Should not be default location, only one is allowed')
def _get_imported_path(): location = Location.getdefault() try: filesPrefix = FileServer.objects.get(name=location).filesPrefix except: filesPrefix = FileServer.objects.all()[0].filesPrefix return os.path.join(filesPrefix,IMPORT_RIG_FOLDER)
def _get_imported_path(): location = Location.getdefault() try: filesPrefix = FileServer.objects.get(name=location).filesPrefix except: filesPrefix = FileServer.objects.all()[0].filesPrefix return os.path.join(filesPrefix, IMPORT_RIG_FOLDER)
def update_Result(saved_objs): # Set report storage and link result = saved_objs['results'] storage = ReportStorage.objects.filter(default=True)[0] location = Location.getdefault() result.reportstorage = storage result.reportLink = os.path.join(storage.webServerPath, location.name, "%s_%03d" % (result.resultsName, result.pk), "") result.sffLink = os.path.join(result.reportLink, os.path.basename(result.sffLink)) # update metrics FKs on Results result.analysismetrics = saved_objs['analysis metrics'] result.libmetrics = saved_objs['lib metrics'] result.qualitymetrics = saved_objs['quality metrics'] # set status result.status = 'Importing' result.save()
def update_Result(saved_objs): # Set report storage and link result = saved_objs['results'] storage = ReportStorage.objects.filter(default=True)[0] location = Location.getdefault() result.reportstorage = storage result.reportLink = os.path.join( storage.webServerPath, location.name, "%s_%03d" % (result.resultsName, result.pk), "") # update metrics FKs on Results result.analysismetrics = saved_objs['analysis metrics'] result.libmetrics = saved_objs['lib metrics'] result.qualitymetrics = saved_objs['quality metrics'] # set status result.status = 'Importing' result.save()
#!/usr/bin/python # Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved import sys from iondb.bin import djangoinit from iondb.rundb.models import Cruncher, Location NODENAME = sys.argv[1] newnode, created = Cruncher.objects.get_or_create( name=NODENAME, location=Location.getdefault()) if created: sys.stdout.write('%s created' % NODENAME) else: sys.stdout.write('%s exists' % NODENAME)
#!/usr/bin/python # Copyright (C) 2014 Ion Torrent Systems, Inc. All Rights Reserved import sys from iondb.bin import djangoinit from iondb.rundb.models import Cruncher, Location NODENAME = sys.argv[1] newnode, created = Cruncher.objects.get_or_create(name=NODENAME, location=Location.getdefault()) if created: sys.stdout.write('%s created' % NODENAME) else: sys.stdout.write('%s exists' % NODENAME)
def test_save_method(self): l = Location() l.defaultlocation = True l.name = 'HomeTest' l.save() _id = l.id l = Location() l.defaultlocation = True l.name = 'HomeTest' l.save() for l in Location.objects.exclude(id=l.id): self.assertFalse( l.defaultlocation, 'Should not be default location, only one is allowed')