Beispiel #1
0
def storagerestart(request):
    confirm = request.GET.get('conf', None)
    if confirm is not None or getJobsrunningnr(request) == 0:
        status = 1
        call([SUDOCMD, SYSTEMCTL, 'restart', 'bacula-sd'])
    else:
        status = 2
    context = {'status': status}
    return JsonResponse(context)
Beispiel #2
0
def storagerestart(request):
    confirm = request.GET.get('conf', None)
    if confirm is not None or getJobsrunningnr(request) == 0:
        status = 1
        call([SUDOCMD, SYSTEMCTL, 'restart', 'bacula-sd'])
    else:
        status = 2
    context = {'status': status}
    return JsonResponse(context)
Beispiel #3
0
def masterstop(request):
    confirm = request.GET.get('conf', None)
    if confirm is not None or getJobsrunningnr(request) == 0:
        status = 1
        call([SUDOCMD, SYSTEMCTL, 'stop', 'bacula-dir'])
    else:
        status = 2
    context = {'status': status}
    return JsonResponse(context)
Beispiel #4
0
def masterstop(request):
    confirm = request.GET.get('conf', None)
    if confirm is not None or getJobsrunningnr(request) == 0:
        status = 1
        call([SUDOCMD, SYSTEMCTL, 'stop', 'bacula-dir'])
    else:
        status = 2
    context = {'status': status}
    return JsonResponse(context)