Ejemplo n.º 1
0
def detail(request):
    offsite = Offsite.get_instance()
    uploads = list(LocalUploadRequest.objects.all()) + list(
        RemoteUploadRequest.objects.all())
    content = []
    for upload in uploads:
        content.append({
            'type':
            'ok',
            'date':
            upload.last_attempt or upload.created_at,
            'label':
            upload.volume.filename,
            'message':
            "%.2f MB" % utils.bytes_to_mb(upload.volume.size)
        })
    transferencias_em_execucao = [{
        'title': u'Transferências em execução',
        'content': content
    }]

    if offsite.active:
        graphic = Graphics()
        graph_block = graphic.data_to_template()[0]
    else:
        ocupacao_offsite = 0.0
        messages.error(request, "Offsite desativado")
    return render_to_response(request, "detail.html", locals())
Ejemplo n.º 2
0
def detail(request):
    offsite = Offsite.get_instance()
    uploads = list(LocalUploadRequest.objects.all()) + list(RemoteUploadRequest.objects.all())
    content = []
    for upload in uploads:
        content.append({'type' : 'ok',
                        'date' : upload.last_attempt or upload.created_at,
                        'label' : upload.volume.filename,
                        'message' : "%.2f MB" % utils.bytes_to_mb(upload.volume.size)
                       })
    transferencias_em_execucao = [{'title': u'Transferências em execução',
                                   'content': content}]

    if offsite.active:
        graphic = Graphics()
        graph_block = graphic.data_to_template()[0]
    else:
        ocupacao_offsite = 0.0
        messages.error(request, "Offsite desativado")
    return render_to_response(request, "detail.html", locals())
Ejemplo n.º 3
0
 def ratelimit(self):
     self.logger.info('QueueServiceManager.ratelimit')
     offsite = Offsite.get_instance()
     return offsite.rate_limit
Ejemplo n.º 4
0
 def offsite_if_active(self):
     offsite = Offsite.get_instance()
     if offsite.active:
         return offsite
Ejemplo n.º 5
0
 def offsite_if_active(self):
     offsite = Offsite.get_instance()
     if offsite.active:
         return offsite
Ejemplo n.º 6
0
Archivo: S3.py Proyecto: veezor/Nimbus
 def get_plan_size(self):
     from nimbus.offsite.models import Offsite
     conf = Offsite.get_instance()
     return conf.plan_size
Ejemplo n.º 7
0
 def ratelimit(self):
     self.logger.info('QueueServiceManager.ratelimit')
     offsite = Offsite.get_instance()
     return offsite.rate_limit