Пример #1
0
def start_all(args):
    md = ManageDisk()
    for d in md.get_disks_meta():
        if int(args.a) == 1:
            if str(d.disk_name).startswith("auto "):
                md.start(d.id)
        else:
            md.start(d.id)

    if int(args.w) == 0:
        return
    status = False
    while status != True:
        not_complete = False
        for d in md.get_disks_meta():
            if int(args.a) == 1:
                if str(d.disk_name).startswith("auto "):
                    if d.status != DisplayDiskStatus.started:
                        print "wait please."
                        not_complete = True
                        sleep(10)
                        break
            else:
                if d.status != DisplayDiskStatus.started:
                    print "wait please."
                    not_complete = True
                    sleep(10)
                    break
        if not not_complete:
            status = True
    print "All disks started."
Пример #2
0
def start_disk(disk_id, pool):
    if request.method == 'GET' or request.method == 'POST':
        manage_disk = ManageDisk()
        status = manage_disk.start(disk_id, pool)
        if (status != Status.done):
            # session['success'] = "ui_admin_start_disk_success"
            # else:
            session['err'] = "ui_admin_start_disk_error"

        return redirect(url_for('disk_controller.disk_list'))
Пример #3
0
def start_disk(id):
    ceph_manage = ManageDisk()
    ceph_manage.start(id)
Пример #4
0
def start_disk(id,pool):
    manage_disk = ManageDisk()
    if manage_disk.start(id,pool) == Status.done:
        return True
    return False